osBasic 1.0 at downloads.

posted Jun 21, 2012, 11:27 AM by ekvirtanen bass   [ updated Feb 24, 2013, 3:28 AM ]
osBasic is a simple BASIC interpreter written in Basic. It aim's to be similar as common basic interpreters were back in 1980's. Example code of classic nicoma game below.
// nicoma.bas
// osBasic Example by E.K.Virtanen
// https://sites.google.com/site/bungytheworm/
// Public Domain 2009.

1 CLS
2 COLOR 4, 0 : PRINT TAB$(33), "NICOMA"
4 COLOR 14, 0 : PRINT TAB$(15), "CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
6 COLOR 15, 0 : PRINT: PRINT: PRINT
10 PRINT "BOOMERANG PUZZLE FROM ARITHMETICA OF NICOMACHUS -- A.D. 90!"
20 PRINT "PRESS  TO END" : PRINT
30 PRINT "PLEASE THINK OF A NUMBER BETWEEN 1 AND 100."
40 INPUT "YOUR NUMBER DIVIDED BY 3 HAS A REMAINDER OF? ", A%
50 INPUT "YOUR NUMBER DIVIDED BY 5 HAS A REMAINDER OF? ", B%
60 INPUT "YOUR NUMBER DIVIDED BY 7 HAS A REMAINDER OF? ", C%
70 PRINT
80 PRINT "LET ME THINK A MOMENT..."
85 PRINT
90 FOR I% = 1 TO 1500 : NEXT I%
100 LET D% = 70 * A% +21 * B% + 15 *C%
110 IF D% <= 105 THEN GOTO 140
120 LET D% = D% - 105
130 GOTO 110
140 PRINT "YOUR NUMBER WAS ", D%, ", RIGHT (Y/N)? ",
160 INPUT "", A$
165 PRINT
170 IF UPPER$(A$) = "Y" THEN GOTO 220
180 IF UPPER$(A$) = "N" THEN GOTO 240
190 PRINT "EH?  I DON'T UNDERSTAND '";A$;"'  TRY 'Y' OR 'N'."
200 GOTO 160
220 PRINT "HOW ABOUT THAT!!"
230 GOTO 250
240 PRINT "I FEEL YOUR ARITHMETIC IS IN ERROR."
250 PRINT
260 PRINT "LET'S TRY ANOTHER."
270 GOTO 20
999 END
Archive includes binaries for windows with multiple example codes. Linux binaries delivered by request.

Check programs and osbasic.zip
Comments