Download data/examples/12systems/23matchl.bas from introvoyz041/tinybasic: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/12systems/23matchl.bas
- Command line
-
hf download hf://datasets/introvoyz041/tinybasic/data/examples/12systems/23matchl.bas
-
curl -L -o 23matchl.bas https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/12systems/23matchl.bas
1.1 kB
| 10 REM "23 Matches from 101 BASIC games" | |
| 20 REM "Originally written by Bob Albrecht in 1975" | |
| 30 REM "Ported to Stefan's BASIC in 2021" | |
| 40 REM "This version is for a 16*2 LCD display." | |
| 50 @R=MILLIS(1) | |
| 60 REM "Input and output to display from keypad" | |
| 70 @O=2: @I=2 | |
| 100 CLS: PRINT "23 MATCHES" | |
| 110 PRINT "CAN TAKE 1,2,3";: INPUT "", A$ | |
| 120 CLS: PRINT "TAKE THE LAST" | |
| 130 PRINT "AND LOSE";: INPUT "", A$ | |
| 160 N=23 | |
| 170 Q=INT(RND(2)) | |
| 175 CLS: PRINT "MATCHES "; N | |
| 180 IF Q=1 THEN 210 | |
| 190 PRINT "YOU GO FIRST: "; | |
| 200 GOTO 300 | |
| 210 PRINT "I : 2, YOU: "; | |
| 260 N=N-2 | |
| 300 INPUT "", K | |
| 310 CLS: PRINT "MATCHES "; N | |
| 320 IF K>3 OR K<=0 THEN 430 | |
| 340 N=N-K | |
| 350 CLS: PRINT "MATCHES "; N | |
| 355 IF N=4 THEN Z=3: GOTO 390 | |
| 360 IF N=3 THEN Z=2: GOTO 390 | |
| 365 IF N=2 THEN Z=1: GOTO 390 | |
| 370 IF N<=1 THEN 530 | |
| 375 Z=4-K | |
| 390 PRINT "I TAKE "; Z;" YOU: "; | |
| 400 N=N-Z | |
| 410 IF N<=1 THEN 470 | |
| 420 GOTO 300 | |
| 430 PRINT "ONLY 1, 2, 3: "; | |
| 440 GOTO 300 | |
| 470 CLS: PRINT "I BEAT YOU!!!" | |
| 520 GOTO 570 | |
| 530 CLS: PRINT "YOU WON!" | |
| 570 INPUT "ONCE MORE: "; O | |
| 580 IF O=1 THEN GOTO 160 | |
| 590 CLS: PRINT "BYE BYE" | |