Download data/examples/00tutorial/loop.bas from introvoyz041/tinybasic: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/00tutorial/loop.bas
- Command line
-
hf download hf://datasets/introvoyz041/tinybasic/data/examples/00tutorial/loop.bas
-
curl -L -o loop.bas https://huggingface.co/datasets/introvoyz041/tinybasic/resolve/main/data/examples/00tutorial/loop.bas
446 Bytes
| 10 REM "(Advanced) Loops in BASIC" | |
| 20 REM "" | |
| 100 PRINT "FOR loop" | |
| 110 FOR I=0 TO 4 STEP 2 | |
| 120 PRINT I | |
| 130 NEXT | |
| 200 PRINT "BREAK in a loop" | |
| 210 FOR I=1 TO 4 | |
| 220 IF I=3 THEN BREAK | |
| 230 PRINT I | |
| 240 NEXT | |
| 300 PRINT "CONT in a loop" | |
| 310 FOR I=1 TO 4 | |
| 320 IF I=3 THEN CONT | |
| 330 PRINT I | |
| 340 NEXT | |
| 400 PRINT "while" | |
| 410 FOR I | |
| 420 IF I>5 THEN BREAK | |
| 430 PRINT I, I*I | |
| 440 NEXT | |
| 500 PRINT "until" | |
| 510 FOR I | |
| 520 PRINT I, I*I | |
| 530 IF I>5 THEN BREAK | |
| 540 NEXT | |
| 600 END | |