Initial commit

This commit is contained in:
William Moore 2023-08-02 10:10:22 -05:00
parent 9083bd4a47
commit 2027f533b6
3 changed files with 259 additions and 0 deletions

132
src/1802mc/SCC.bas Normal file
View File

@ -0,0 +1,132 @@
1 REM SCC.bas
2 REM Copyright (C) 2023 William R. Moore
3 REM
4 REM This program is free software: you can redistribute it and/or modify
5 REM it under the terms of the GNU General Public License as published by
6 REM the Free Software Foundation, either version 3 of the License, or
7 REM (at your option) any later version.
8 REM
9 REM This program is distributed in the hope that it will be useful,
10 REM but WITHOUT ANY WARRANTY; without even the implied warranty of
11 REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 REM GNU General Public License for more details.
13 REM
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/>.
20 REM R, S, T, U, V ARE DIFF DICE
21 DEFINT R
22 DEFINT S
23 DEFINT T
24 DEFINT U
25 DEFINT V
30 REM H, C, D ARE
31 REM SHIP, CAPT, CREW
32 OUT(0,4,0)
40 H=0:C=0:D=0
50 REM I IS INP, G IS TURNS
60 I=0:R=0:S=0:T=0:U=0:V=0:G=0:E=0:J=0
100 REM INPUT LOOP
110 I=INP(0,4)
120 IF I <> 128 GOTO 110
121 GOSUB 7000
130 I=INP(0,4)
140 IF I=2 E=1:J=0:GOSUB 3000
141 IF I=3 J=1:GOSUB 3000
150 IF I=1 IF G<3 J=0:GOSUB 2000:G=G+1
160 IF G=3 E=1:J=0:GOSUB 3000
161 IF I=128 GOTO 40
170 WAIT(200)
180 GOTO 130
1000 IF H=0 GOSUB 6000:GOSUB 5000
1001 IF H=0 RETURN
1010 IF H=1 GOSUB 1040
1020 IF C=0 RETURN
1030 IF D=0 RETURN
1040 RETURN
1050 IF C=0 GOSUB 6050:GOSUB 5060
1060 IF C=0 RETURN
1070 IF C=1 IF D=0 GOSUB 6100:GOSUB 5120
1080 RETURN
2000 GOSUB 1000
2010 IF R > -1 R = RND(6)
2020 IF S > -1 S = RND(6)
2030 IF T > -1 T = RND(6)
2040 IF U > -1 U = RND(6)
2050 IF V > -1 V = RND(6)
2060 GOSUB 4000
2070 RETURN
3000 IF J=0 GOSUB 4000
3010 OUT(0, 4, O)
3020 IF I=0 IF G=3 GOTO 40
3021 RETURN
4000 L=0
4001 IF H = 1 L = L + 4
4002 IF C = 1 L = L + 2
4003 IF D = 1 L = L + 1
4010 IF J=0 O=0
4020 IF R >= 0 O = O + R
4030 IF S >= 0 O = O + S
4040 IF T >= 0 O = O + T
4050 IF U >= 0 O = O + U
4060 IF V >= 0 O = O + V
4061 IF E=1 IF L=7 O=O+128
4070 IF L<8 IF I=2 O = 64
4080 IF L<8 IF G=3 O = 64
4081 IF J=0 IF E=0 IF I<>3 OUT(0, 4, L)
4082 IF J=0 IF E=0 IF I<>3 OUT(0, 4, L)
4090 RETURN
5000 IF R = 5 R = -1:RETURN
5010 IF S = 5 S = -1:RETURN
5020 IF T = 5 T = -1:RETURN
5030 IF U = 5 U = -1:RETURN
5040 IF V = 5 V = -1:RETURN
5050 RETURN
5060 IF R = 4 R = -1:RETURN
5070 IF S = 4 S = -1:RETURN
5080 IF T = 4 T = -1:RETURN
5090 IF U = 4 U = -1:RETURN
5100 IF V = 4 V = -1:RETURN
5110 RETURN
5120 IF R = 3 R = -1:RETURN
5130 IF S = 3 S = -1:RETURN
5140 IF T = 3 T = -1:RETURN
5150 IF U = 3 U = -1:RETURN
5160 IF V = 3 V = -1:RETURN
5170 RETURN
6000 IF R=5 H=1:RETURN
6010 IF S=5 H=1:RETURN
6020 IF T=5 H=1:RETURN
6030 IF U=5 H=1:RETURN
6040 IF V=5 H=1:RETURN
6041 RETURN
6050 IF R=4 C=1:RETURN
6060 IF S=4 C=1:RETURN
6070 IF T=4 C=1:RETURN
6080 IF U=4 C=1:RETURN
6090 IF V=4 C=1:RETURN
6091 RETURN
6100 IF R=3 D=1:RETURN
6110 IF S=3 D=1:RETURN
6120 IF T=3 D=1:RETURN
6130 IF U=3 D=1:RETURN
6140 IF V=3 D=1:RETURN
7000 N=129
7010 OUT (0,4,N)
7020 WAIT(8)
7030 N=66
7040 OUT (0,4,N)
7050 WAIT(8)
7060 N=36
7070 OUT (0,4,N)
7080 WAIT(8)
7090 N=24
7100 OUT (0,4,N)
7110 WAIT(8)
7120 N=36
7130 OUT (0,4,N)
7140 WAIT(8)
7150 N=66
7160 OUT (0,4,N)
7170 WAIT(8)
7180 OUT (0,4,0)
7190 RETURN

41
src/altair8800/FAFNIR.bas Normal file
View File

@ -0,0 +1,41 @@
1 REM FAFNIR.bas
2 REM Copyright (C) 2023 William R. Moore
3 REM
4 REM This program is free software: you can redistribute it and/or modify
5 REM it under the terms of the GNU General Public License as published by
6 REM the Free Software Foundation, either version 3 of the License, or
7 REM (at your option) any later version.
8 REM
9 REM This program is distributed in the hope that it will be useful,
10 REM but WITHOUT ANY WARRANTY; without even the implied warranty of
11 REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 REM GNU General Public License for more details.
13 REM
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/>.
20 DIM D(6),H(6)
30 RANDOMIZE
40 D(1)=0:D(2)=0:D(3)=0:D(4)=0:D(5)=0:D(6)=0
50 T=0:T1=0
60 PRINT "PRESS ANY KEY TO CONTINUE..."
70 X$ = INPUT$(1)
80 H(1)=0:H(2)=0:H(3)=0:H(4)=0:H(5)=0:H(6)=0
90 I=INP(255)
100 IF I AND 1 THEN H(1)=1
101 IF I AND 2 THEN H(2)=1
102 IF I AND 4 THEN H(3)=1
103 IF I AND 8 THEN H(4)=1
104 IF I AND 16 THEN H(5)=1
105 IF I AND 32 THEN H(6)=1
110 T1=T1+1
115 IF T1 = 3 THEN GOTO 180
120 FOR P=1 TO 6
130 IF D(P) = 0 OR H(P) = 0 THEN D(P) = INT(6*RND(6)+1)
135 T=T+D(P)
140 NEXT P
150 PRINT "DICE FACES:"
155 PRINT D(1), D(2), D(3), D(4), D(5), D(6)
160 IF H(1)=1 AND H(2)=1 AND H(3)=1 AND H(4)=1 AND H(5)=1 AND H(6)=1 THEN GOTO 180
170 GOTO 50
180 PRINT "GAME OVER!"
190 END

86
src/altair8800/SCC.bas Normal file
View File

@ -0,0 +1,86 @@
1 REM SCC.bas
2 REM Copyright (C) 2023 William R. Moore
3 REM
4 REM This program is free software: you can redistribute it and/or modify
5 REM it under the terms of the GNU General Public License as published by
6 REM the Free Software Foundation, either version 3 of the License, or
7 REM (at your option) any later version.
8 REM
9 REM This program is distributed in the hope that it will be useful,
10 REM but WITHOUT ANY WARRANTY; without even the implied warranty of
11 REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 REM GNU General Public License for more details.
13 REM
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/>.
20 REM R, S, T, U, V ARE DIFF DICE
30 REM H, C, D ARE
31 REM SHIP, CAPT, CREW
40 RANDOMIZE(0)
50 DIM D(5)
55 H=0:C=0:D=0
50 REM I IS INP, G IS TURNS
60 I=0:D(1)=0:D(2)=0:D(3)=0:D(4)=0:D(5)=0:G=0:E=0:J=0:B=0
100 REM INPUT LOOP
110 PRINT "PRESS ANY KEY TO CONTINUE..."
120 X$ = INPUT$(1)
130 I=INP(255)
140 IF I AND 1 THEN GOSUB 2000:G=G+1
150 IF H=1 AND C=1 AND D=1 THEN B=0:GOSUB 7000
160 IF I AND 2 OR G=3 THEN PRINT "GAME OVER! YOU SCORED: ", B:GOTO 55
170 GOTO 110
1000 IF H=0 THEN GOSUB 6000:GOSUB 5000
1001 IF H=0 THEN RETURN
1010 IF H=1 THEN GOSUB 1050
1020 IF C=0 THEN RETURN
1030 IF D=0 THEN RETURN
1040 RETURN
1050 IF C=0 THEN GOSUB 6050:GOSUB 5060
1060 IF C=0 THEN RETURN
1070 IF C=1 AND D=0 THEN GOSUB 6100:GOSUB 5120
1080 RETURN
2000 FOR P=1 TO 5
2010 IF D(P) > -1 THEN D(P)=INT(6*RND(6)+1)
2020 NEXT P
2030 GOSUB 1000
2040 GOSUB 4000
2050 RETURN
4000 L=0
4001 IF H = 1 THEN PRINT "SHIP"
4002 IF C = 1 THEN PRINT "CAPTAIN"
4003 IF D = 1 THEN PRINT "CREW"
4010 O=0
4020 FOR P=1 TO 5
4030 IF D(P) > -1 THEN O=O+D(P)
4040 NEXT P
4050 PRINT "TOTAL: ", O
4060 RETURN
5000 FOR P=1 TO 5
5010 IF D(P)=5 THEN D(P)=-1:RETURN
5020 NEXT P
5050 RETURN
5060 FOR P=1 TO 5
5070 IF D(P)=4 THEN D(P)=-1:RETURN
5080 NEXT P
5090 RETURN
5120 FOR P=1 TO 5
5130 IF D(P)=3 THEN D(P)=-1:RETURN
5140 NEXT P
5150 RETURN
6000 FOR P=1 TO 5
6010 IF D(P)=5 THEN H=1:RETURN
6020 NEXT P
6030 RETURN
6050 FOR P=1 TO 5
6060 IF D(P)=4 THEN C=1:RETURN
6070 NEXT P
6080 RETURN
6100 FOR P=1 TO 5
6120 IF D(P)=3 THEN D=1:RETURN
6130 NEXT P
6140 RETURN
7000 B=0
7010 FOR P=1 TO 5
7020 IF D(P)>=0 THEN B=B+D(P)
7030 NEXT P
7040 RETURN