Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
REM TinyBASIC has only two control flow structures: goto and gosub
|
||||
LET N = 0
|
||||
10 LET N = N + 1
|
||||
PRINT N
|
||||
IF N < 10 THEN GOTO 10
|
||||
|
||||
LET R = 10
|
||||
|
||||
15 IF N < 10000 THEN GOSUB 20
|
||||
IF N > 10000 THEN GOTO 30
|
||||
GOTO R + 5 REM goto can be computed
|
||||
|
||||
20 LET N = N * 2
|
||||
PRINT N
|
||||
RETURN REM gosub returns to where it was called from
|
||||
REM meaning it can be called from multiple
|
||||
REM places in the program
|
||||
|
||||
30 LET N = 0
|
||||
40 GOSUB 105-N REM gosub can be computed as well
|
||||
IF N <= 5 THEN GOTO 40
|
||||
END
|
||||
|
||||
100 PRINT "ZERO"
|
||||
101 PRINT "1"
|
||||
102 PRINT "22"
|
||||
103 PRINT "333"
|
||||
104 PRINT "4444"
|
||||
105 PRINT "55555"
|
||||
LET N = N + 1
|
||||
RETURN REM one return can serve several gosubs
|
||||
Loading…
Add table
Add a link
Reference in a new issue