This little program is basically a program that randomly generates a number and you have to guess it. Here it is:
Scan report for https://www.dropbox.com/s/nlv1eu7yisnutnv/Game.rar?dl=0 at2014-09-30 16:44:19 UTC - VirusTotal
Online Virus Scanner
Dropbox - Game.rar
' Variables Dim Guess, Number As Integer Dim Space As String Start: Console.Clear() ' Randomizer Randomize() Number = Int(Rnd() * 10) + 1 Space = " " Console.WriteLine() Console.WriteLine(Space & "Guess the number game") Console.WriteLine(Space & "=====================") Console.WriteLine() Console.WriteLine("I am thinking of a number between 1 and 10.") Console.WriteLine() Console.Write("Enter a number: ") Guess = Console.ReadLine ' If 1 If Guess = Number Then GoTo CorrectGuess End If ' If 2 If Guess Number Then Console.Write("Your guess is too high, try again: ") End If Guess = Console.ReadLine() ' If 3 If Guess Number Then Console.Write("Your guess is too high, try again: ") End If Guess = Console.ReadLine() ' If 4 If Guess = Number Then GoTo CorrectGuess Else GoTo IncorrectGuess End If IncorrectGuess: Console.WriteLine() Console.WriteLine("Unlucky, you lost. The actual number was " & Number) Console.ReadLine() GoTo Start End CorrectGuess: Console.WriteLine() Console.WriteLine("Well done, you guessed correctly.") Console.ReadLine() GoTo Start End Randomize()
There's a little bug that only affects the game if you guess correctly on second attempt, just close it and reopen.