Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (31 sloc) 773 Bytes
#!/usr/bin/tibasic
100 REM SECRET NUMBER
110 RANDOMIZE
120 MSG1$="SECRET NUMBER IS"
130 MSG2$="YOUR TWO NUMBERS"
140 CALL CLEAR
150 INPUT "ENTER LIMIT? ":LIMIT
160 SECRET=INT(LIMIT*RND)+1
170 CALL CLEAR
180 N=N+1
190 INPUT "LOW,HIGH GUESSES:":LOW,HIGH
200 IF LOW<>HIGH THEN 220
210 IF SECRET=LOW THEN 300
220 IF SECRET<LOW THEN 260
230 IF SECRET>HIGH THEN 280
240 PRINT MSG1$&" BETWEEN":MSG2$
250 GOTO 180
260 PRINT MSG1$&" LESS THAN":MSG2$
270 GOTO 180
280 PRINT MSG1$&" LARGER THAN":MSG2$
290 GOTO 180
300 PRINT "YOU GUESSED THE SECRET"
310 PRINT "NUMBER IN ";N;"TRIES"
320 PRINT "WANT TO PLAY AGAIN?"
330 INPUT "ENTER Y OR N: ":A$
340 IF A$<>"Y" THEN 390
350 N=0
360 PRINT "WANT TO SET A NEW LIMIT?"
370 INPUT "ENTER Y OR N: ":B$
380 IF B$="Y" THEN 140 ELSE 160
390 END