home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / l / l074 / 1.ddi / GUESS.TRU < prev    next >
Encoding:
Text File  |  1984-12-19  |  482 b   |  21 lines

  1. ! Program to play a guessing game.
  2. !
  3. RANDOMIZE
  4. LET answer = Int(Rnd*6) + 1      ! Choose number from 1 to 6
  5.  
  6. PRINT "I'm thinking of a number from 1 to 6."
  7. PRINT "You have 3 chances to guess it."
  8. PRINT
  9. FOR chance = 1 to 3
  10.    PRINT "Enter your guess";     ! Ask for number
  11.    INPUT guess
  12.    IF guess = answer then
  13.       PRINT "Correct!!!"
  14.       STOP                       ! Stop here, you guessed it
  15.    END IF
  16. NEXT chance
  17.  
  18. PRINT
  19. PRINT "The number was"; answer
  20. END
  21.