30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
LET MAX=10 20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
is trivial! 10 LET MAX=10 20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
random number And so is input 10 LET MAX=10 20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
random number And so is input 10 LET MAX=10 20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60 Highly visible control flow without looking up names
input Function getting a random number 10 LET MAX=10 20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60 No tabs vs. spaces
random number And so is input 10 LET MAX=10 20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60 No tabs vs. spaces No snake_case vs CamelCase
random number And so is input 10 LET MAX=10 20 LET X = 0 30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60 No tabs vs. spaces No snake_case vs CamelCase No naming of functions or types
30 GOTO 60 40 X = INT(RND(1)*(MAX-1) + 1) 50 RETURN 60 GOSUB 40 70 LET TIMES=0 80 LET GUESS=0 90 LET MAXGUESS = 5 100 PRINT "Guess a number between 1 and ", MAX 110 FOR TIMES = 1 TO MAXGUESS 120 INPUT GUESS 130 IF GUESS == X THEN GOTO 220 140 LET RELATIVE="big" 150 IF GUESS > X THEN GOTO 170 160 RELATIVE = "small" 170 PRINT "Too ", RELATIVE 180 NEXT 190 PRINT "Fail after ", MAXGUESS, " tries" 200 PRINT "The number is ", X 210 GOTO 230 220 PRINT "Only ", TIMES, " guesses. Well done!" 230 LET RETRY = "N" 240 INPUT "Want to try again (Y/N)?", RETRY 250 IF RETRY=="Y"||RETRY=="y" THEN GOTO 60
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; }
_20: LET X = 0; _30: GOTO _60; _40: X = INT(RND(1)*(MAX-1) + 1); _50: RETURN; _60: GOSUB _40; _70: LET TIMES=0; _80: LET GUESS=0; _90: LET MAXGUESS = 5; _100:PRINT "Guess a number between 1 and ", MAX; _110:FOR TIMES = 1 TO MAXGUESS; _120:INPUT GUESS; _130:IF GUESS == X THEN GOTO _220; _140:LET RELATIVE="big"; _150:IF GUESS > X THEN GOTO _170; _160:RELATIVE = "small"; _170:PRINT "Too ", RELATIVE; _180:NEXT; _190:PRINT "Fail after ", MAXGUESS, " tries"; _200:PRINT "The number is ", X; _210:GOTO _230; _220:PRINT "Only ", TIMES, " guesses. Well done!"; _230:LET RETRY = "N"; _240:INPUT "Want to try again (Y/N)?", RETRY; _250:IF RETRY=="Y"||RETRY=="y" THEN GOTO _60; } C++ today is as simple as BASIC was in the 80s!