Update to correct small bugs in SCC for MC

This commit is contained in:
William Moore 2023-08-06 09:19:47 -05:00
parent 6b7d88da69
commit 0bddf60f87

View File

@ -13,19 +13,19 @@
13 REM 13 REM
14 REM You should have received a copy of the GNU General Public License 14 REM You should have received a copy of the GNU General Public License
15 REM along with this program. If not, see <http://www.gnu.org/licenses/>. 15 REM along with this program. If not, see <http://www.gnu.org/licenses/>.
50 DIM D(5) 50 DIM D(6)
60 H=0:C=0:K=0:I=0:G=0:E=0:J=0:B=0 60 H=0:C=0:K=0:I=0:G=0:E=0:J=0:B=0
61 FOR P=1 TO 5 61 FOR P=1 TO 5
62 D(P)=0 62 D(P)=7
63 NEXT P 63 NEXT P
100 REM INPUT LOOP 100 REM INPUT LOOP
110 PRINT "TOGGLE SWITCHES AND ENTER ANY KEY TO CONTINUE..." 110 PRINT "TOGGLE SWITCHES AND ENTER ANY KEY TO CONTINUE..."
120 INPUT X$ 120 INPUT X$
130 I=INP(0,4) 130 I=INP(0,4)
140 IF I=1 GOSUB 2000:G=G+1 140 IF I=1 GOSUB 2000:G=G+1
150 IF I=2 PRINT "GAME OVER!":GOSUB 8000:GOTO 60 150 IF I=2 PRINT "GAME OVER!":GOSUB 8000:GOTO 50
160 IF I=4 PRINT "GAME OVER!":GOSUB 8000:END 160 IF I=4 PRINT "GAME OVER!":GOSUB 8000:END
170 IF G=3 PRINT "GAME OVER!":GOSUB 8000:GOTO 60 170 IF G=3 PRINT "GAME OVER!":GOSUB 8000:GOTO 50
180 IF H=1 IF C=1 IF K=1 B=0:GOSUB 7000 180 IF H=1 IF C=1 IF K=1 B=0:GOSUB 7000
190 GOTO 110 190 GOTO 110
1000 IF H=0 GOSUB 6000:GOSUB 5000 1000 IF H=0 GOSUB 6000:GOSUB 5000
@ -41,7 +41,7 @@
2000 FOR P=1 TO 5 2000 FOR P=1 TO 5
2001 DEFINT A 2001 DEFINT A
2002 A=RND(6) 2002 A=RND(6)
2010 IF D(P) > -1 D(P)=A 2010 IF D(P)>-1 D(P)=A
2020 NEXT P 2020 NEXT P
2030 GOSUB 1000 2030 GOSUB 1000
2040 GOSUB 4000 2040 GOSUB 4000
@ -52,8 +52,11 @@
4003 IF K=1 PRINT "CREW" 4003 IF K=1 PRINT "CREW"
4010 O=0 4010 O=0
4020 FOR P=1 TO 5 4020 FOR P=1 TO 5
4030 IF D(P) > -1 O=O+D(P)+1 4030 IF D(P)>-1 IF D(P)<7 O=O+D(P)+1
4040 NEXT P 4040 NEXT P
4041 IF H=0 O=0
4042 IF C=0 O=0
4043 IF K=0 O=0
4050 PRINT "TOTAL: ", O 4050 PRINT "TOTAL: ", O
4060 RETURN 4060 RETURN
5000 FOR P=1 TO 5 5000 FOR P=1 TO 5
@ -82,7 +85,7 @@
6140 RETURN 6140 RETURN
7000 B=0 7000 B=0
7010 FOR P=1 TO 5 7010 FOR P=1 TO 5
7020 IF D(P)>=0 B=B+D(P)+1 7020 IF D(P)>-1 IF D(P)<7 B=B+D(P)+1
7030 NEXT P 7030 NEXT P
7040 RETURN 7040 RETURN
8000 IF H=1 IF C=1 IF K=1 GOSUB 7000 8000 IF H=1 IF C=1 IF K=1 GOSUB 7000