Guessing Game

We all know that simple game called "What number im thingking at?"

Here is a bit modified version of it. At start, program randoms 5 numbers between 1 to 100. Then it ask's you to guess number.
If your guess is bigger, it prints Number in yellow, and if your guess is smaller, it prints Number in red.
If number is allready guessed correctly, it prints Number in green.

You dont see any numbers, not even correctly guessed ones until all 5 numbers are guessed correctly.
At the end, program shows you all numbers, and how many rounds you have played. My best recors is 19 rounds. There is somthing for you to beat. ;D

``````' UPDATE: 7'th Nov. 2007 for FB .18
' Guess what number. Version 0.001
' Simple stuff, just compile and run.
' you get the thrill.
' Created by E.K.Virtanen. Copy, modifye, edit, eat, drink or what ever with this

' You can quit, by goin over Max or under Min values.
' Basicly its 0 or > 100

Randomize Timer
CLS

' Lets set Min and Max values just to make code look bit better
Dim AS INTEGER Min, Max, i
Min = 1 : Max = 100

' 5 randomed numbers on array. These are what we are tying to guess.
DIM Numbers(5,2) AS INTEGER
For i = 1 TO 5
Numbers(i,1) = INT(RND * 100) + 1
Numbers(i,2) = 1
Next i

' This is what player types at each round and how many rounds played. Guessed is number of correctly guessed numbers.
Dim AS INTEGER Guess, Rounds, Guessed
Rounds = 0 : Guessed = 0
DO
Rounds = Rounds + 1 : Guessed = 0
Color 15
LOCATE 18,10 : Print "Round playing now:"; Rounds
LOCATE 20,10 : Input "Enter your guess. Between 1 to 100";Guess
CLS
IF Guess < Min OR Guess > Max Then END

For i = 1 TO 5
IF Guess = Numbers(i,1) Then Numbers(i,2) = 0
IF Numbers(i,1) < Guess Then Color 14
IF Numbers(i,1) > Guess Then Color 12
IF Numbers(i,2) = 0 Then
Color 10 : Guessed = Guessed + 1
END IF
LOCATE i+5, 15 : Print "Number:"; i;
Next i
IF Guessed = 5 Then EXIT DO
Loop

CLS
For i = 1 TO 5
LOCATE i,5, 15 : Print "Number:"; i ; " was "; Numbers(i,1);
Next i
Locate 15,15 : Print "Total rounds needed:"; Rounds
Sleep```
```