Some fixes for BINSIC

Standard

I have made a few small, but important, fixes to BINSIC, the reimplementation of BASIC I have built using Groovy.

You can download the jar file (which can be run in any standard Java environment) from here: http://88.198.44.150/binsic.jar

Here’s another BASIC “game” (it’s amazing that this sort of thing used to fascinate those of us with these machines), for you to try – it was fixing this up that helped me find the bugs:

10 REM **DICE GAME**SLR/1983**
20 LET A=0
30 LET B=0
40 PRINT "DICE GAME"
60 PRINT "YOUR THROW="
70 GOSUB 160
80 PRINT "MY THROW="
90 GOSUB 220
100 IF A>B THEN PRINT "YOU WIN"
110 IF A<B THEN PRINT "I WIN"
120 IF A = B THEN PRINT "TIE"
130 LET X$ = INKEY$
132 IF X$ = "" THEN GOTO 130
136 CLS
140 IF X$ = "S" THEN STOP
150 GOTO 10
160 FOR G=1 TO 2
170 LET Z=INT (RND*6+1)
180 LET A=A+Z
190 GOSUB 280
195 PRINT
200 NEXT G
210 RETURN
220 FOR G=1 TO 2
230 LET Z=INT (RND*6+1)
240 LET B=B+Z
250 GOSUB 280
260 NEXT G
270 RETURN
280 REM Draw
282 PAUSE 100
285 IF Z = 1 THEN GOSUB 500
290 IF Z = 2 THEN GOSUB 600
300 IF Z = 3 THEN GOSUB 700
310 IF Z = 4 THEN GOSUB 800
320 IF Z = 5 THEN GOSUB 900
330 IF Z = 6 THEN GOSUB 1000
340 RETURN
400 PRINT "[ ][ ][ ]"
410 RETURN
420 PRINT "[*][ ][*]"
430 RETURN
440 PRINT "[ ][*][ ]"
450 RETURN
460 PRINT "[*][ ][ ]"
470 RETURN
480 PRINT "[ ][ ][*]"
490 RETURN
500 REM 1
510 GOSUB 400
520 GOSUB 440
530 GOSUB 400
540 RETURN
600 REM 2
610 GOSUB 460
620 GOSUB 400
630 GOSUB 480
640 RETURN
700 REM 3
710 GOSUB 460
720 GOSUB 440
730 GOSUB 480
740 RETURN
800 REM 4
810 GOSUB 420
820 GOSUB 400
830 GOSUB 420
840 RETURN
900 REM 5
910 GOSUB 420
920 GOSUB 440
930 GOSUB 420
940 RETURN
1000 REM 6
1010 GOSUB 420
1020 GOSUB 420
1030 GOSUB 420
1040 RETURN

The original game can be found here: http://zx81.reids4fun.com/zx81/dice/dice_list.html – I had to change it to cope with the main weakness of BINSIC – that GOTOs to lines inside loops fail.