mirror of
https://github.com/rfivet/BCG101.git
synced 2024-12-17 23:56:24 -05:00
Compare commits
2 Commits
61ec965375
...
ba4d30b9ff
Author | SHA1 | Date | |
---|---|---|---|
ba4d30b9ff | |||
f72a7c4c91 |
192
dec/CHECKR.BAS
Normal file
192
dec/CHECKR.BAS
Normal file
@ -0,0 +1,192 @@
|
||||
100 PRINT" THIS PROGRAM WILL PLAY CHECKERS. THE COMPUTER IS X,"
|
||||
200 PRINT"AND YOU ARE O. THE COMPUTER WILL GO FIRST,-NOTE: SQUARES"
|
||||
300 PRINT"ARE IN THE FORM-(X,Y) AND SQ. 1,1 IS THE BOTTOM LEFT!"
|
||||
400 PRINT"DO NOT ATTEMPT A DOUBLE JUMP OR YOUR PIECE MIGHT JUST "
|
||||
500 PRINT"DISAPPEAR(SAME FOR A TRIPLE!)"
|
||||
600 PRINT" WAIT FOR THE COMP. TO MOVE!!!!!"
|
||||
700 LET G=-1
|
||||
800 DIM R(50)
|
||||
900 LET L=-1
|
||||
1000 DIM S(10,10)
|
||||
1100 DATA 1,0,1,0,0,0,-1,0,0,1,0,0,0,-1,0,-1,15
|
||||
1200 FOR X=1TO8
|
||||
1300 FOR Y=1TO8
|
||||
1400 READ J
|
||||
1500 IF J=15 THEN 1800
|
||||
1600 LET S(X,Y)=J
|
||||
1700 GOTO 2000
|
||||
1800 RESTORE
|
||||
1900 READ S(X,Y)
|
||||
2000 NEXT Y
|
||||
2100 NEXT X
|
||||
2200 REM
|
||||
2300LETL=-1*L
|
||||
2400 FOR X=1TO8
|
||||
2500 FOR Y=1TO8
|
||||
2600 IF S(X,Y)=0 THEN 3500
|
||||
2700 IF G>0 THEN 3000
|
||||
2800 IF S(X,Y)>0 THEN 3500
|
||||
2900 GOTO 3100
|
||||
3000 IF S(X,Y)<0 THEN 3500
|
||||
3100 IF ABS(S(X,Y))<>1 THEN 3300
|
||||
3200 GOSUB 4300
|
||||
3300 IF ABS(S(X,Y))<>2 THEN 3500
|
||||
3400 GOSUB 6500
|
||||
3500IFX<>8 THEN 3800
|
||||
3600IFL=1 THEN 3800
|
||||
3700RETURN
|
||||
3800NEXT Y
|
||||
3900NEXT X
|
||||
4000PRINT
|
||||
4100GOSUB11400
|
||||
4200 GOTO 2300
|
||||
4300 FOR A=-1TO1 STEP 2
|
||||
4400 LET U=X+A
|
||||
4500 LET V=Y+G
|
||||
4600 IF U<1 THEN 6300
|
||||
4700 IF U>8 THEN 6300
|
||||
4800 IF V<1 THEN 6300
|
||||
4900 IF V>8 THEN 6300
|
||||
5000 IF S(U,V)<>0 THEN 5300
|
||||
5100 GOSUB 9100
|
||||
5200 GOTO 6300
|
||||
5300 IF S(U,V)=G THEN 6300
|
||||
5400 IF S(U,V)=2*G THEN 6300
|
||||
5500 LET U=U+A
|
||||
5600 LET V=V+G
|
||||
5700 IF U<1 THEN 6300
|
||||
5800 IF U>8 THEN 6300
|
||||
5900 IF V<1 THEN 6300
|
||||
6000 IF V>8 THEN 6300
|
||||
6100 IF S(U,V)<>0 THEN 6300
|
||||
6200 GOSUB 9100
|
||||
6300 NEXT A
|
||||
6400 RETURN
|
||||
6500 REM KING MOVES
|
||||
6600 FOR A=-1TO1 STEP 2
|
||||
6700 FOR B=-1TO1 STEP 2
|
||||
6800 LET U=X+A
|
||||
6900 LET V=Y+B
|
||||
7000 IF U<1 THEN 8700
|
||||
7100 IF U>8 THEN 8700
|
||||
7200 IF V<1 THEN 8700
|
||||
7300 IF V>8 THEN8700
|
||||
7400 IF S(U,V)<>0 THEN 7700
|
||||
7500 GOSUB 9100
|
||||
7600 GOTO 8700
|
||||
7700 IF S(U,V)=G THEN 8700
|
||||
7800 IF S(U,V)=2*G THEN 8700
|
||||
7900 LET U=U+A
|
||||
8000 LET V=V+B
|
||||
8100 IF U<1 THEN 8700
|
||||
8200 IF U>8 THEN 8700
|
||||
8300 IF V<1 THEN 8700
|
||||
8400 IF V>8 THEN 8700
|
||||
8500 IF S(U,V)<>0 THEN 8700
|
||||
8600 GOSUB 9100
|
||||
8700 NEXT B
|
||||
8800 NEXT A
|
||||
8900 RETURN
|
||||
9000 GOTO 14200
|
||||
9100 REM
|
||||
9200 LET P=P+1
|
||||
9300 IF P=K THEN 12300
|
||||
9400IF V<>(4.5+(3.5*G)) THEN 9600
|
||||
9500 LET Q=Q+2
|
||||
9600 IF X<>(4.5-(3.5*G)) THEN 9800
|
||||
9700LET Q=Q-2
|
||||
9800 REM
|
||||
9900 IF U<>1 THEN 10100
|
||||
10000 LET Q=Q+1
|
||||
10100 IF U<>8 THEN 10300
|
||||
10200 LET Q=Q+1
|
||||
10300 FOR C=-1TO1 STEP 2
|
||||
10400 IF S(U+C,V+G)<1 THEN 10800
|
||||
10500 LET Q=Q-1
|
||||
10600 IF S(U-C,V-G)<>0 THEN 10800
|
||||
10700 LET Q=Q-1
|
||||
10800 REM THIS WAS THE EVALUATION SECTION
|
||||
10900 REM
|
||||
11000 NEXT C
|
||||
11100 LET R(P)=Q
|
||||
11200 LETQ=0
|
||||
11300 RETURN
|
||||
11400 IF P=0 THEN 18800
|
||||
11500 FOR J=10TO-10 STEP -1
|
||||
11600 FOR F=1TOP
|
||||
11700 IF R(F)=J THEN 12000
|
||||
11800 NEXT F
|
||||
11900 NEXTJ
|
||||
12000 LET K=F+P
|
||||
12100 GOSUB 2300
|
||||
12200 RETURN
|
||||
12300 PRINT" I MOVE FROM ("X;Y") TO ("U;V")"
|
||||
12400 LET F=0
|
||||
12500 LET P=0
|
||||
12600 LET K=0
|
||||
12700 IF V<>(4.5+(3.5*G)) THEN 13000
|
||||
12800 LET S(U,V)=2*G
|
||||
12900 GOTO 13100
|
||||
13000 LET S(U,V)=S(X,Y)
|
||||
13100 LET S(X,Y)=0
|
||||
13200 IF ABS(X-U)<>2 THEN 13400
|
||||
13300 LET S((X+U)/2,(Y+V)/2)=0
|
||||
13400 PRINT"BOARD";
|
||||
13500 INPUT D$
|
||||
13600 IF D$<>"YES" THEN13900
|
||||
13700 GOSUB 14100
|
||||
13800 RETURN
|
||||
13900 GOSUB 15800
|
||||
14000 RETURN
|
||||
14100 PRINT
|
||||
14200 FOR Y=8TO1 STEP -1
|
||||
14300 FOR X=1TO8
|
||||
14400 LET I=2*X
|
||||
14500 IF S(X,Y)<>0 THEN 14700
|
||||
14600 PRINT TAB(I)".";
|
||||
14700 IF S(X,Y)<>1 THEN 14900
|
||||
14800 PRINT TAB(I)"O";
|
||||
14900 IF S(X,Y)<>-1 THEN 15100
|
||||
15000 PRINT TAB(I)"X";
|
||||
15100 IF S(X,Y)<>-2 THEN 15300
|
||||
15200 PRINT TAB(I)"X";TAB(I)"*";
|
||||
15300 IF S(X,Y)<>2 THEN 15500
|
||||
15400 PRINT TAB(I)"O";TAB(I)"*";
|
||||
15500 NEXT X
|
||||
15600 PRINT
|
||||
15700 NEXT Y
|
||||
15800 PRINT
|
||||
15900 PRINT"FROM";
|
||||
16000 INPUT E,H
|
||||
16100 LET X=E
|
||||
16200 LET Y=H
|
||||
16300 IF S(X,Y)<>0 THEN 16700
|
||||
16400 PRINT "THERE IS NO ONE OCCUPING THAT SPACE"
|
||||
16500 PRINT
|
||||
16600 GOTO 15900
|
||||
16700 PRINT"TO";
|
||||
16800 INPUT A,B
|
||||
16900 LET X=A
|
||||
17000 LET Y=B
|
||||
17100 IF S(X,Y)=0 THEN 17500
|
||||
17200 PRINT"THAT SPACE IS ALREADY OCCUPIED"
|
||||
17300 PRINT
|
||||
17400 GOTO 16700
|
||||
17500 LET S(A$B)=S(E,H)
|
||||
17600 LET S(A,B)=S(E,H)
|
||||
17700 LET S(E,H)=0
|
||||
17800 LET T=(4.5-(3.5*G))
|
||||
17900 IF ABS(E-A)<>2 THEN 18100
|
||||
18000 LET S((E+A)/2,(H+B)/2)=0
|
||||
18100 IF B<>T THEN 18300
|
||||
18200 LET S(A,B)=-2*G
|
||||
18300 FOR X=8TO8
|
||||
18400 FOR Y=8TO8
|
||||
18500 RETURN
|
||||
18600 NEXT Y
|
||||
18700 NEXT X
|
||||
18800 PRINT" VERY GOOD, YOU WIN!"
|
||||
18900 PRINT
|
||||
19000 PRINT
|
||||
19100 PRINT" -CHUCK OUT"
|
||||
19200 END
|
102
port/BLKJAK.BAS
Normal file
102
port/BLKJAK.BAS
Normal file
@ -0,0 +1,102 @@
|
||||
5 PRINT "WELCOME TO DIGITAL EDUSYSTEM COMPUTER BLACKJACK!!"
|
||||
6 PRINT\PRINT "YOUR DEALER TONIGHT IS PETEY P. EIGHT."
|
||||
7 PRINT "WATCH HIM CLOSELY.... HE HAS A REPUTATION FOR"
|
||||
8 PRINT "DEALING OFF THE BOTTOM OF THE DECK."\PRINT
|
||||
9 RANDOMIZE
|
||||
10 DIM A(13)
|
||||
20 PRINT "QUESTIONS REQUIRING A YES OR NO ANSWER"
|
||||
25 PRINT "SHOULD BE ANSWERED WITH A 'Y' FOR YES, 'N' FOR NO."\PRINT
|
||||
30 PRINT "DON'T START PLAYING WITH LESS THAN $100.. HAVE FUN!"\PRINT
|
||||
40 PRINT "HOW MANY DOLLARS ARE YOU STARTING WITH";
|
||||
41 INPUT F
|
||||
42 PRINT
|
||||
43 F1=F
|
||||
50 PRINT "WHAT IS YOUR WAGER THIS TIME";
|
||||
51 INPUT W
|
||||
52 PRINT
|
||||
53 IF W>F GOTO 56
|
||||
54 IF W<10 GOTO 58
|
||||
55 GOTO 100
|
||||
56 PRINT "YOUR BET EXCEEDS YOUR REMAINING DOLLARS."
|
||||
57 GOTO 50
|
||||
58 PRINT "MINIMUM WAGER IS $10."
|
||||
59 GOTO 50
|
||||
100 GOSUB 780
|
||||
102 P1=I
|
||||
104 PRINT "YOUR FIRST CARD IS "CHR$(L)
|
||||
106 GOSUB 780
|
||||
110 P2=I
|
||||
112 PRINT "YOUR SECOND CARD IS "CHR$(L)
|
||||
115 GOSUB 200
|
||||
117 PRINT "YOU HAVE "P3" SHOWING."
|
||||
119 GOSUB 760
|
||||
120 P3=P3+I
|
||||
122 PRINT "YOU GOT A "CHR$(L)
|
||||
123 IF P3>21 GOTO 820
|
||||
124 GOTO 117
|
||||
200 GOSUB 780
|
||||
201 P3=P1+P2
|
||||
202 D1=I
|
||||
204 GOSUB 780
|
||||
206 D2=I
|
||||
208 PRINT "DEALER SHOWS A "CHR$(L)
|
||||
210 GOTO 117
|
||||
212 D3=D1+D2
|
||||
214 PRINT "DEALER HAS "D3
|
||||
216 IF D3>16 GOTO 222
|
||||
217 GOSUB 780
|
||||
218 PRINT "DEALER GETS A "CHR$(L)
|
||||
219 D3=D3+I
|
||||
220 GOTO 214
|
||||
222 IF D3<22 GOTO 800
|
||||
224 PRINT "DEALER BUSTED."
|
||||
226 GOTO 802
|
||||
760 PRINT "DO YOU WANT A HIT";
|
||||
762 INPUT K$
|
||||
764 PRINT
|
||||
766 IF K$="N" GOTO 212
|
||||
768 GOSUB 780
|
||||
770 RETURN
|
||||
780 I=INT(13*RND(0)+1)
|
||||
782 A(I)=A(I)+1
|
||||
784 IF A(I)>4 GOTO 780
|
||||
786 GOSUB 900
|
||||
788 RETURN
|
||||
800 IF D3>=P3 GOTO 820
|
||||
802 F=F+W
|
||||
806 PRINT "YOU WIN. YOU NOW HAVE $"F
|
||||
808 GOTO 980
|
||||
820 F=F-W
|
||||
822 PRINT "YOU LOSE. YOU NOW HAVE $"F
|
||||
824 GOTO 980
|
||||
900 IF I<>1 GOTO 910
|
||||
904 I=11
|
||||
906 L=65 ' #A
|
||||
908 GOTO 942
|
||||
910 IF I<>13 GOTO 920
|
||||
912 I=10
|
||||
914 L=75 ' #K
|
||||
916 GOTO 942
|
||||
920 IF I<>12 GOTO 930
|
||||
922 I=10
|
||||
924 L=81 ' #Q
|
||||
926 GOTO 942
|
||||
930 IF I<>11 GOTO 937
|
||||
932 I=10
|
||||
934 L=74 ' #J
|
||||
936 GOTO 942
|
||||
937 IF I<>10 GOTO 940
|
||||
938 L=84 ' #T
|
||||
939 GOTO 942
|
||||
940 L=I+48
|
||||
942 RETURN
|
||||
980 PRINT "DO YOU WISH TO PLAY AGAIN";
|
||||
982 INPUT K$
|
||||
984 PRINT\PRINT
|
||||
986 IF K$="Y" GOTO 50
|
||||
987 PRINT\PRINT\PRINT \IF F>F1 THEN 995
|
||||
988 PRINT "TOO BAD! YOU LOST"F1-F"DOLLARS AT THE EDUSYSTEM CASINO."
|
||||
990 GOTO 998
|
||||
995 PRINT "NOT BAD! YOU WON"F-F1"DOLLARS AT THE EDUSYSTEM CASINO."
|
||||
998 PRINT\PRINT "HOPE YOU ENJOYED YOURSELF. THANKS FOR PLAYING."
|
||||
999 END
|
@ -1,102 +0,0 @@
|
||||
5 PRINT "WELCOME TO DIGITAL EDUSYSTEM COMPUTER BLACKJACK!!"
|
||||
6 PRINT\PRINT "YOUR DEALER TONIGHT IS PETEY P. EIGHT."
|
||||
7 PRINT "WATCH HIM CLOSELY.... HE HAS A REPUTATION FOR"
|
||||
8 PRINT "DEALING OFF THE BOTTOM OF THE DECK."\PRINT
|
||||
9 RANDOMIZE
|
||||
10 DIM A(13)
|
||||
20 PRINT "QUESTIONS REQUIRING A YES OR NO ANSWER"
|
||||
25 PRINT "SHOULD BE ANSWERED WITH A 'Y' FOR YES, 'N' FOR NO."\PRINT"
|
||||
30 PRINT "DON'T START PLAYING WITH LESS THAN $100.. HAVE FUN!"\PRINT
|
||||
40 PRINT "HOW MANY DOLLARS ARE YOU STARTING WITH";
|
||||
41 INPUT F
|
||||
42 PRINT
|
||||
43 F1=F
|
||||
50 PRINT "WHAT IS YOUR WAGER THIS TIME";
|
||||
51 INPUT W
|
||||
52 PRINT
|
||||
53 IF W>F GOTO 56
|
||||
54 IF W<10 GOTO 58
|
||||
55 GOTO 100
|
||||
56 PRINT "YOUR BET EXCEEDS YOUR REMAINING DOLLARS."
|
||||
57 GOTO 50
|
||||
58 PRINT "MINIMUM WAGER IS $10."
|
||||
59 GOTO 50
|
||||
100 GOSUB 780
|
||||
102 P1=I
|
||||
104 PRINT "YOUR FIRST CARD IS "CHR$(L)
|
||||
106 GOSUB 780
|
||||
110 P2=I
|
||||
112 PRINT "YOUR SECOND CARD IS "CHR$(L)
|
||||
115 GOSUB 200
|
||||
117 PRINT "YOU HAVE "P3" SHOWING."
|
||||
119 GOSUB 760
|
||||
120 P3=P3+I
|
||||
122 PRINT "YOU GOT A "CHR$(L)
|
||||
123 IF P3>21 GOTO 820
|
||||
124 GOTO 117
|
||||
200 GOSUB 780
|
||||
201 P3=P1+P2
|
||||
202 D1=I
|
||||
204 GOSUB 780
|
||||
206 D2=I
|
||||
208 PRINT "DEALER SHOWS A "CHR$(L)
|
||||
210 GOTO 117
|
||||
212 D3=D1+D2
|
||||
214 PRINT "DEALER HAS "D3
|
||||
216 IF D3>16 GOTO 222
|
||||
217 GOSUB 780
|
||||
218 PRINT "DEALER GETS A "CHR$(L)
|
||||
219 D3=D3+I
|
||||
220 GOTO 214
|
||||
222 IF D3<22 GOTO 800
|
||||
224 PRINT "DEALER BUSTED."
|
||||
226 GOTO 802
|
||||
760 PRINT "DO YOU WANT A HIT";
|
||||
762 INPUT K$
|
||||
764 PRINT
|
||||
766 IF K="N" GOTO 212
|
||||
768 GOSUB 780
|
||||
770 RETURN
|
||||
780 I=INT(13*RND(0)+1)
|
||||
782 A(I)=A(I)+1
|
||||
784 IF A(I)>4 GOTO 780
|
||||
786 GOSUB 900
|
||||
788 RETURN
|
||||
800 IF D3>=P3 GOTO 820
|
||||
802 F=F+W
|
||||
806 PRINT "YOU WIN. YOU NOW HAVE $"F
|
||||
808 GOTO 980
|
||||
820 F=F-W
|
||||
822 PRINT "YOU LOSE. YOU NOW HAVE $"F
|
||||
824 GOTO 980
|
||||
900 IF I<>1 GOTO 910
|
||||
904 I=11
|
||||
906 L=65 ' #A
|
||||
908 GOTO 942
|
||||
910 IF I<>13 GOTO 920
|
||||
912 I=10
|
||||
914 L=75 ' #K
|
||||
916 GOTO 942
|
||||
920 IF I<>12 GOTO 930
|
||||
922 I=10
|
||||
924 L=81 ' #Q
|
||||
926 GOTO 942
|
||||
930 IF I<>11 GOTO 937
|
||||
932 I=10
|
||||
934 L=74 ' #J
|
||||
936 GOTO 942
|
||||
937 IF I<>10 GOTO 940
|
||||
938 L=84 ' #T
|
||||
939 GOTO 942
|
||||
940 L=I+48
|
||||
942 RETURN
|
||||
980 PRINT "DO YOU WISH TO PLAY AGAIN";
|
||||
982 INPUT K$
|
||||
984 PRINT\PRINT
|
||||
986 IF K$="Y" GOTO 50
|
||||
987 PRINT\PRINT\PRINT \IF F>F1 THEN 995
|
||||
988 PRINT "TOO BAD! YOU LOST"F1-F"DOLLARS AT THE EDUSYSTEM CASINO."
|
||||
990 GOTO 998
|
||||
995 PRINT "NOT BAD! YOU WON"F-F1"DOLLARS AT THE EDUSYSTEM CASINO."
|
||||
998 PRINT\PRINT "HOPE YOU ENJOYED YOURSELF. THANKS FOR PLAYING."
|
||||
999 END
|
192
port/CHECKR.BAS
Normal file
192
port/CHECKR.BAS
Normal file
@ -0,0 +1,192 @@
|
||||
10 PRINT" THIS PROGRAM WILL PLAY CHECKERS. THE COMPUTER IS X,"
|
||||
20 PRINT"AND YOU ARE O. THE COMPUTER WILL GO FIRST,-NOTE: SQUARES"
|
||||
30 PRINT"ARE IN THE FORM-(X,Y) AND SQ. 1,1 IS THE BOTTOM LEFT!"
|
||||
40 PRINT"DO NOT ATTEMPT A DOUBLE JUMP OR YOUR PIECE MIGHT JUST "
|
||||
50 PRINT"DISAPPEAR(SAME FOR A TRIPLE!)"
|
||||
60 PRINT" WAIT FOR THE COMP. TO MOVE!!!!!"
|
||||
70 LET G=-1
|
||||
80 DIM R(50)
|
||||
90 LET L=-1
|
||||
100 DIM S(10,10)
|
||||
110 DATA 1,0,1,0,0,0,-1,0,0,1,0,0,0,-1,0,-1,15
|
||||
120 FOR X=1TO8
|
||||
130 FOR Y=1TO8
|
||||
140 READ J
|
||||
150 IF J=15 THEN 180
|
||||
160 LET S(X,Y)=J
|
||||
170 GOTO 200
|
||||
180 RESTORE
|
||||
190 READ S(X,Y)
|
||||
200 NEXT Y
|
||||
210 NEXT X
|
||||
220 REM
|
||||
230LETL=-1*L
|
||||
240 FOR X=1TO8
|
||||
250 FOR Y=1TO8
|
||||
260 IF S(X,Y)=0 THEN 350
|
||||
270 IF G>0 THEN 300
|
||||
280 IF S(X,Y)>0 THEN 350
|
||||
290 GOTO 310
|
||||
300 IF S(X,Y)<0 THEN 350
|
||||
310 IF ABS(S(X,Y))<>1 THEN 330
|
||||
320 GOSUB 430
|
||||
330 IF ABS(S(X,Y))<>2 THEN 350
|
||||
340 GOSUB 650
|
||||
350IFX<>8 THEN 380
|
||||
360IFL=1 THEN 380
|
||||
370RETURN
|
||||
380NEXT Y
|
||||
390NEXT X
|
||||
400PRINT
|
||||
410GOSUB1140
|
||||
420 GOTO 230
|
||||
430 FOR A=-1TO1 STEP 2
|
||||
440 LET U=X+A
|
||||
450 LET V=Y+G
|
||||
460 IF U<1 THEN 630
|
||||
470 IF U>8 THEN 630
|
||||
480 IF V<1 THEN 630
|
||||
490 IF V>8 THEN 630
|
||||
500 IF S(U,V)<>0 THEN 530
|
||||
510 GOSUB 910
|
||||
520 GOTO 630
|
||||
530 IF S(U,V)=G THEN 630
|
||||
540 IF S(U,V)=2*G THEN 630
|
||||
550 LET U=U+A
|
||||
560 LET V=V+G
|
||||
570 IF U<1 THEN 630
|
||||
580 IF U>8 THEN 630
|
||||
590 IF V<1 THEN 630
|
||||
600 IF V>8 THEN 630
|
||||
610 IF S(U,V)<>0 THEN 630
|
||||
620 GOSUB 910
|
||||
630 NEXT A
|
||||
640 RETURN
|
||||
650 REM KING MOVES
|
||||
660 FOR A=-1TO1 STEP 2
|
||||
670 FOR B=-1TO1 STEP 2
|
||||
680 LET U=X+A
|
||||
690 LET V=Y+B
|
||||
700 IF U<1 THEN 870
|
||||
710 IF U>8 THEN 870
|
||||
720 IF V<1 THEN 870
|
||||
730 IF V>8 THEN870
|
||||
740 IF S(U,V)<>0 THEN 770
|
||||
750 GOSUB 910
|
||||
760 GOTO 870
|
||||
770 IF S(U,V)=G THEN 870
|
||||
780 IF S(U,V)=2*G THEN 870
|
||||
790 LET U=U+A
|
||||
800 LET V=V+B
|
||||
810 IF U<1 THEN 870
|
||||
820 IF U>8 THEN 870
|
||||
830 IF V<1 THEN 870
|
||||
840 IF V>8 THEN 870
|
||||
850 IF S(U,V)<>0 THEN 870
|
||||
860 GOSUB 910
|
||||
870 NEXT B
|
||||
880 NEXT A
|
||||
890 RETURN
|
||||
900 GOTO 1420
|
||||
910 REM
|
||||
920 LET P=P+1
|
||||
930 IF P=K THEN 1230
|
||||
940IF V<>(4.5+(3.5*G)) THEN 960
|
||||
950 LET Q=Q+2
|
||||
960 IF X<>(4.5-(3.5*G)) THEN 980
|
||||
970LET Q=Q-2
|
||||
980 REM
|
||||
990 IF U<>1 THEN 1010
|
||||
1000 LET Q=Q+1
|
||||
1010 IF U<>8 THEN 1030
|
||||
1020 LET Q=Q+1
|
||||
1030 FOR C=-1TO1 STEP 2
|
||||
1040 IF S(U+C,V+G)<1 THEN 1080
|
||||
1050 LET Q=Q-1
|
||||
1060 IF S(U-C,V-G)<>0 THEN 1080
|
||||
1070 LET Q=Q-1
|
||||
1080 REM THIS WAS THE EVALUATION SECTION
|
||||
1090 REM
|
||||
1100 NEXT C
|
||||
1110 LET R(P)=Q
|
||||
1120 LETQ=0
|
||||
1130 RETURN
|
||||
1140 IF P=0 THEN 1880
|
||||
1150 FOR J=10TO-10 STEP -1
|
||||
1160 FOR F=1TOP
|
||||
1170 IF R(F)=J THEN 1200
|
||||
1180 NEXT F
|
||||
1190 NEXT J
|
||||
1200 LET K=F+P
|
||||
1210 GOSUB 230
|
||||
1220 RETURN
|
||||
1230 PRINT" I MOVE FROM ("X;Y") TO ("U;V")"
|
||||
1240 LET F=0
|
||||
1250 LET P=0
|
||||
1260 LET K=0
|
||||
1270 IF V<>(4.5+(3.5*G)) THEN 1300
|
||||
1280 LET S(U,V)=2*G
|
||||
1290 GOTO 1310
|
||||
1300 LET S(U,V)=S(X,Y)
|
||||
1310 LET S(X,Y)=0
|
||||
1320 IF ABS(X-U)<>2 THEN 1340
|
||||
1330 LET S((X+U)/2,(Y+V)/2)=0
|
||||
1340 PRINT"BOARD";
|
||||
1350 INPUT D$
|
||||
1360 IF D$<>"YES" THEN1390
|
||||
1370 GOSUB 1410
|
||||
1380 RETURN
|
||||
1390 GOSUB 1580
|
||||
1400 RETURN
|
||||
1410 PRINT
|
||||
1420 FOR Y=8TO1 STEP -1
|
||||
1430 FOR X=1TO8
|
||||
1440 LET I=2*X
|
||||
1450 IF S(X,Y)<>0 THEN 1470
|
||||
1460 PRINT TAB(I)".";
|
||||
1470 IF S(X,Y)<>1 THEN 1490
|
||||
1480 PRINT TAB(I)"O";
|
||||
1490 IF S(X,Y)<>-1 THEN 1510
|
||||
1500 PRINT TAB(I)"X";
|
||||
1510 IF S(X,Y)<>-2 THEN 1530
|
||||
1520 PRINT TAB(I)"X*";
|
||||
1530 IF S(X,Y)<>2 THEN 1550
|
||||
1540 PRINT TAB(I)"O*";
|
||||
1550 NEXT X
|
||||
1560 PRINT
|
||||
1570 NEXT Y
|
||||
1580 PRINT
|
||||
1590 PRINT"FROM";
|
||||
1600 INPUT E,H
|
||||
1610 LET X=E
|
||||
1620 LET Y=H
|
||||
1630 IF S(X,Y)<>0 THEN 1670
|
||||
1640 PRINT "THERE IS NO ONE OCCUPYING THAT SPACE"
|
||||
1650 PRINT
|
||||
1660 GOTO 1590
|
||||
1670 PRINT"TO";
|
||||
1680 INPUT A,B
|
||||
1690 LET X=A
|
||||
1700 LET Y=B
|
||||
1710 IF S(X,Y)=0 THEN 1750
|
||||
1720 PRINT"THAT SPACE IS ALREADY OCCUPIED"
|
||||
1730 PRINT
|
||||
1740 GOTO 1670
|
||||
1750 ' LET S(A$B)=S(E,H)
|
||||
1760 LET S(A,B)=S(E,H)
|
||||
1770 LET S(E,H)=0
|
||||
1780 LET T=(4.5-(3.5*G))
|
||||
1790 IF ABS(E-A)<>2 THEN 1810
|
||||
1800 LET S((E+A)/2,(H+B)/2)=0
|
||||
1810 IF B<>T THEN 1830
|
||||
1820 LET S(A,B)=-2*G
|
||||
1830 FOR X=8TO8
|
||||
1840 FOR Y=8TO8
|
||||
1850 RETURN
|
||||
1860 NEXT Y
|
||||
1870 NEXT X
|
||||
1880 PRINT" VERY GOOD, YOU WIN!"
|
||||
1890 PRINT
|
||||
1900 PRINT
|
||||
1910 PRINT" -CHUCK OUT"
|
||||
1920 END
|
Loading…
Reference in New Issue
Block a user