A little game I pro...
 
Notifications
Clear all

A little game I programmed v1

Page 1 / 2

Posts: 0
Topic starter
(@Legless)
New Member
Joined: 10 years ago

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.

Reply
Name of the Video Game, and any other Tags
6 Replies
Posts: 0
Topic starter
(@Legless)
New Member
Joined: 10 years ago

xLust
Joshy
Glitchy

Reply
Posts: 0
Topic starter
(@Legless)
New Member
Joined: 10 years ago

Amazing

Reply
Posts: 0
(@Joshy)
New Member
Joined: 10 years ago

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()

That's a cool one Legless, can utilize it to pick winners for contests and stuff like that in the future. (y)

Reply
Posts: 0
Topic starter
(@Legless)
New Member
Joined: 10 years ago

That's a cool one Legless, can utilize it to pick winners for contests and stuff like that in the future. (y)

There's v2 😉

Reply
Page 1 / 2