Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
10 LET A%=1: REM A HAS A VALUE OF TRUE
|
||||
20 IF A% THEN PRINT "A IS TRUE"
|
||||
30 WE CAN OF COURSE USE EXPRESSIONS
|
||||
40 IF A%<>0 THEN PRINT "A IS TRUE"
|
||||
50 IF NOT(A%) THEN PRINT "A IS FALSE"
|
||||
60 REM SOME VERSIONS OF BASIC PROVIDE AN ELSE KEYWORD
|
||||
70 IF A% THEN PRINT "A IS TRUE" ELSE PRINT "A IS FALSE"
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
IF x = 0 THEN doSomething
|
||||
IF x < 0 THEN doSomething ELSE doOtherThing
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
IF x > 0 AND x < 10 THEN
|
||||
'do stuff
|
||||
ELSE IF x = 0 THEN
|
||||
'do other stuff
|
||||
ELSE
|
||||
'do more stuff
|
||||
END IF
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
IF aNumber THEN
|
||||
'the number is not 0
|
||||
ELSE
|
||||
'the number is 0
|
||||
END IF
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
SELECT CASE expression
|
||||
CASE 1
|
||||
'do stuff
|
||||
CASE 2, 3
|
||||
'do other stuff
|
||||
CASE 3.1 TO 9.9
|
||||
'do this
|
||||
CASE IS >= 10
|
||||
'do that
|
||||
CASE ELSE
|
||||
'default case
|
||||
END SELECT
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
10 INPUT "Enter 1,2 or 3: ";v
|
||||
20 GOTO v * 100
|
||||
99 STOP
|
||||
100 PRINT "Apple"
|
||||
110 STOP
|
||||
200 PRINT "Banana"
|
||||
210 STOP
|
||||
300 PRINT "Cherry"
|
||||
310 STOP
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
10 REM while loop
|
||||
20 L=0
|
||||
30 WHILE L<5
|
||||
40 PRINT L
|
||||
50 L=L+1
|
||||
60 WEND
|
||||
70 REM repeat loop
|
||||
80 L=1
|
||||
90 REPEAT
|
||||
100 PRINT L
|
||||
110 L=L+1
|
||||
120 UNTIL L>5
|
||||
Loading…
Add table
Add a link
Reference in a new issue