1
0
mirror of https://github.com/rfivet/BCG101.git synced 2024-12-18 16:16:32 -05:00

Add first refactored version and second program code and port.

This commit is contained in:
Renaud 2024-04-19 15:02:30 +08:00
parent 088a4a2998
commit 8648a48419
3 changed files with 430 additions and 0 deletions

189
dec/AMAZIN.BAS Normal file
View File

@ -0,0 +1,189 @@
100 RANDOMIZE
110 DIM W(25,103),V(25,103)
120 PRINT "WHAT ARE YOUR WIDTH AND LENGTH?"
121 INPUT H,V
122 PRINT
130 IF H<>1 THEN 150
131 IF V<>1 THEN 150
132 PRINT "MEANINGLESS DIMENSIONS, TRY AGAIN"
140 PRINT
141 GO TO 120
150 PRINT
151 PRINT
160 LET Q=0
161 LET Z=0
162 LET X=INT(RND(0)*H+1)
163 FOR I=1 TO H
170 IF I=X THEN 173
171 PRINT ":--";
172 GO TO 180
173 PRINT ": ";
180 NEXT I
190 PRINT ":"
191 LET C=1
192 LET W(X,1)=C
193 LET C=C+1
200 LET R=X
201 LET S=1
202 GO TO 260
210 IF R<>H THEN 240
211 IF S<>V THEN 230
220 LET R=1
221 LET S=1
222 GO TO 250
230 LET R=1
231 LET S=S+1
232 GO TO 250
240 LET R=R+1
250 IF W(R,S)=0 THEN 210
260 IF R-1=0 THEN 530
261 IF W(R-1,S)<>0 THEN 530
270 IF S-1=0 THEN 390
280 IF W(R,S-1)<>0 THEN 390
290 IF R=H THEN 330
300 IF W(R+1,S)<>0 THEN 330
310 LET X=INT(RND(0)*3+1)
320 IF X=1 THEN 790
321 IF X=2 THEN 820
323 IF X=3 THEN 860
330 IF S<>V THEN 340
331 IF Z=1 THEN 370
332 LET Q=1
333 GO TO 350
340 IF W(R,S+1)<>0 THEN 370
350 LET X=INT(RND(0)*3+1)
360 IF X=1 THEN 790
361 IF X=2 THEN 820
362 IF X=3 THEN 910
370 LET X=INT(RND(0)*2+1)
380 IF X=1 THEN 790
381 IF X=2 THEN 820
390 IF R=H THEN 470
400 IF W(R+1,S)<>0 THEN 470
401 IF S<>V THEN 420
410 IF Z=1 THEN 450
411 LET Q=1
412 GO TO 430
420 IF W(R,S+1)<>0 THEN 450
430 LET X=INT(RND(0)*3+1)
440 IF X=1 THEN 790
441 IF X=2 THEN 860
442 IF X=3 THEN 910
450 LET X=INT(RND(0)*2+1)
460 IF X=1 THEN 790
461 IF X=2 THEN 860
470 IF S<>V THEN 490
480 IF Z=1 THEN 520
481 LET Q=1
482 GO TO 500
490 IF W(R,S+1)<>0 THEN 520
500 LET X=INT(RND(0)*2+1)
510 IF X=1 THEN 790
511 IF X=2 THEN 910
520 GO TO 790
530 IF S-1=0 THEN 670
540 IF W(R,S-1)<>0 THEN 670
541 IF R=H THEN 610
542 IF W(R+1,S)<>0 THEN 610
550 IF S<>V THEN 560
551 IF Z=1 THEN 590
552 LET Q=1
553 GO TO 570
560 IF W(R,S+1)<>0 THEN 590
570 LET X=INT(RND(0)*3+1)
580 IF X=1 THEN 820
581 IF X=2 THEN 860
582 IF X=3 THEN 910
590 LET X=INT(RND(0)*2+1)
600 IF X=1 THEN 820
601 IF X=2 THEN 860
610 IF S<>V THEN 630
620 IF Z=1 THEN 660
621 LET Q=1
622 GO TO 640
630 IF W(R,S+1)<>0 THEN 660
640 LET X=INT(RND(0)*2+1)
650 IF X=1 THEN 820
651 IF X=2 THEN 910
660 GO TO 820
670 IF R=H THEN 740
680 IF W(R+1,S)<>0 THEN 740
681 IF S<>V THEN 700
690 IF Z=1 THEN 730
691 LET Q=1
692 GO TO 830
700 IF W(R,S+1)<>0 THEN 730
710 LET X=INT(RND(0)*2+1)
720 IF X=1 THEN 860
721 IF X=2 THEN 910
730 GO TO 860
740 IF S<>V THEN 760
750 IF Z=1 THEN 780
751 LET Q=1
752 GO TO 770
760 IF W(R,S+1)<>0 THEN 780
770 GO TO 910
780 GO TO 1000
790 LET W(R-1,S)=C
800 LET C=C+1
801 LET V(R-1,S)=2
802 LET R=R-1
810 IF C=H*V+1 THEN 1010
811 LET Q=0
812 GO TO 260
820 LET W(R,S-1)=C
830 LET C=C+1
840 LET V(R,S-1)=1
841 LET S=S-1
842 IF C=H*V+1 THEN 1010
850 LET Q=0
851 GO TO 260
860 LET W(R+1,S)=C
870 LET C=C+1
871 IF V(R,S)=0 THEN 880
872 LET V(R,S)=3
873 GO TO 890
880 LET V(R,S)=2
890 LET R=R+1
900 IF C=H*V+1 THEN 1010
902 GO TO 530
910 IF Q=1 THEN 960
920 LET W(R,S+1)=C
921 LET C=C+1
922 IF V(R,S)=0 THEN 940
930 LET V(R,S)=3
931 GO TO 950
940 LET V(R,S)=1
950 LET S=S+1
951 IF C=H*V+1 THEN 1010
952 GO TO 260
960 LET Z=1
970 IF V(R,S)=0 THEN 980
971 LET V(R,S)=3
972 LET Q=0
973 GO TO 1000
980 LET V(R,S)=1
981 LET Q=0
982 LET R=1
990 LET S=1
991 GO TO 250
1000 GO TO 210
1010 FOR J=1 TO V
1011 PRINT"I";
1012 FOR I=1 TO H
1013 IF V(I,J)<2 THEN 1030
1020 PRINT" ";
1021 GO TO 1040
1030 PRINT" I";
1040 NEXT I
1041 PRINT
1043 FOR I=1 TO H
1045 IF V(I,J)=0 THEN 1060
1050 IF V(I,J)=2 THEN 1060
1051 PRINT": ";
1052 GO TO 1070
1060 PRINT ":--";
1070 NEXT I
1071 PRINT":"
1072 NEXT J
1073 END

50
factory/ACEYDU.BAS Normal file
View File

@ -0,0 +1,50 @@
10 REM *** GAME OF ACEY-DUCEY WRITTEN BY BILL PALMBY
30 REM *** TRANSLATED TO RSTS/E BY DAVE AHL, DIGITAL
40 REM *** EDUSYSTEM 50 REFACTORING BY RENAUD FIVET
80 DIM D$(3)\ D$(0)="JACK"\ D$(1)="QUEEN"\ D$(2)="KING"\ D$(3)="ACE"
90 DEF FNC(C)=INT(13*RND(1))+2
100 RANDOMIZE
101 PRINT "ACEY-DUCEY IS PLAYED IN THE FOLLOWING MANNER:"
102 PRINT "THE DEALER (COMPUTER) DEALS TWO CARDS FACE UP."
103 PRINT "YOU HAVE THE OPTION TO BET OR NOT TO BET DEPENDING"
104 PRINT "ON WHETHER OR NOT YOU FEEL THE NEXT CARD WILL HAVE"
105 PRINT "A VALUE BETWEEN THE FIRST TWO."
106 PRINT "IF YOU DO NOT WANT TO BET, INPUT A 0."
110 PRINT
160 Q=100
190 PRINT "YOU NOW HAVE"Q"DOLLARS."
195 PRINT
260 PRINT "HERE ARE YOUR NEXT TWO CARDS..."
270 A=FNC(A)
300 B=FNC(B)
330 IF A>=B THEN 270
340 C=A\ GOSUB 760
500 C=B\ GOSUB 760
650 PRINT
660 PRINT "WHAT IS YOUR BET";\INPUT M
670 IF M>0 THEN 680
675 PRINT "CHICKEN!!"\PRINT
677 GOTO 260
680 IF M<=Q THEN 730
690 PRINT "SORRY, MY FRIEND, BUT YOU BET TOO MUCH"
700 PRINT "YOU HAVE ONLY"Q"DOLLARS TO BET."
710 GOTO 650
730 C=FNC(C)\ GOSUB 760
740 GOTO 910
760 IF C<11 THEN 810
770 PRINT " ";D$(C-11)
780 RETURN
810 PRINT C
820 RETURN
910 IF C<=A THEN 970
930 IF C>=B THEN 970
950 Q=Q+M\ PRINT "YOU WIN!!!"
960 GOTO 190
970 Q=Q-M\ PRINT "SORRY, YOU LOSE."
980 IF Q>0 THEN 190
1000 PRINT
1010 PRINT "SORRY, FRIEND, BUT YOU BLEW YOUR WAD."
1020 PRINT "TRY AGAIN (YES OR NO)";\INPUT A$
1030 IF A$="YES" THEN 110
1040 PRINT\PRINT "O.K. HOPE YOU HAD FUN!!"
1050 END

191
port/AMAZIN.BAS Normal file
View File

@ -0,0 +1,191 @@
10 ' AMAZIN -- DRAW A MAZE
20 ' QUICK PORT TO EDUSYSTEM 50 BY RENAUD FIVET
100 RANDOMIZE
110 DIM W(12,12),V(12,12)
120 PRINT "WHAT ARE YOUR WIDTH AND LENGTH?"
121 INPUT H,V
122 PRINT
130 IF H<2 THEN 132\ IF H>12 THEN 132
131 IF V<2 THEN 132\ IF V<=12 THEN 150
132 PRINT "MEANINGLESS DIMENSIONS, TRY AGAIN"
140 PRINT
141 GO TO 120
150 PRINT
151 PRINT
160 LET Q=0
161 LET Z=0
162 LET X=INT(RND(0)*H+1)
163 FOR I=1 TO H
170 IF I=X THEN 173
171 PRINT ":--";
172 GO TO 180
173 PRINT ": ";
180 NEXT I
190 PRINT ":"
191 LET C=1
192 LET W(X,1)=C
193 LET C=C+1
200 LET R=X
201 LET S=1
202 GO TO 260
210 IF R<>H THEN 240
211 IF S<>V THEN 230
220 LET R=1
221 LET S=1
222 GO TO 250
230 LET R=1
231 LET S=S+1
232 GO TO 250
240 LET R=R+1
250 IF W(R,S)=0 THEN 210
260 IF R-1=0 THEN 530
261 IF W(R-1,S)<>0 THEN 530
270 IF S-1=0 THEN 390
280 IF W(R,S-1)<>0 THEN 390
290 IF R=H THEN 330
300 IF W(R+1,S)<>0 THEN 330
310 LET X=INT(RND(0)*3+1)
320 IF X=1 THEN 790
321 IF X=2 THEN 820
323 IF X=3 THEN 860
330 IF S<>V THEN 340
331 IF Z=1 THEN 370
332 LET Q=1
333 GO TO 350
340 IF W(R,S+1)<>0 THEN 370
350 LET X=INT(RND(0)*3+1)
360 IF X=1 THEN 790
361 IF X=2 THEN 820
362 IF X=3 THEN 910
370 LET X=INT(RND(0)*2+1)
380 IF X=1 THEN 790
381 IF X=2 THEN 820
390 IF R=H THEN 470
400 IF W(R+1,S)<>0 THEN 470
401 IF S<>V THEN 420
410 IF Z=1 THEN 450
411 LET Q=1
412 GO TO 430
420 IF W(R,S+1)<>0 THEN 450
430 LET X=INT(RND(0)*3+1)
440 IF X=1 THEN 790
441 IF X=2 THEN 860
442 IF X=3 THEN 910
450 LET X=INT(RND(0)*2+1)
460 IF X=1 THEN 790
461 IF X=2 THEN 860
470 IF S<>V THEN 490
480 IF Z=1 THEN 520
481 LET Q=1
482 GO TO 500
490 IF W(R,S+1)<>0 THEN 520
500 LET X=INT(RND(0)*2+1)
510 IF X=1 THEN 790
511 IF X=2 THEN 910
520 GO TO 790
530 IF S-1=0 THEN 670
540 IF W(R,S-1)<>0 THEN 670
541 IF R=H THEN 610
542 IF W(R+1,S)<>0 THEN 610
550 IF S<>V THEN 560
551 IF Z=1 THEN 590
552 LET Q=1
553 GO TO 570
560 IF W(R,S+1)<>0 THEN 590
570 LET X=INT(RND(0)*3+1)
580 IF X=1 THEN 820
581 IF X=2 THEN 860
582 IF X=3 THEN 910
590 LET X=INT(RND(0)*2+1)
600 IF X=1 THEN 820
601 IF X=2 THEN 860
610 IF S<>V THEN 630
620 IF Z=1 THEN 660
621 LET Q=1
622 GO TO 640
630 IF W(R,S+1)<>0 THEN 660
640 LET X=INT(RND(0)*2+1)
650 IF X=1 THEN 820
651 IF X=2 THEN 910
660 GO TO 820
670 IF R=H THEN 740
680 IF W(R+1,S)<>0 THEN 740
681 IF S<>V THEN 700
690 IF Z=1 THEN 730
691 LET Q=1
692 GO TO 830
700 IF W(R,S+1)<>0 THEN 730
710 LET X=INT(RND(0)*2+1)
720 IF X=1 THEN 860
721 IF X=2 THEN 910
730 GO TO 860
740 IF S<>V THEN 760
750 IF Z=1 THEN 780
751 LET Q=1
752 GO TO 770
760 IF W(R,S+1)<>0 THEN 780
770 GO TO 910
780 GO TO 1000
790 LET W(R-1,S)=C
800 LET C=C+1
801 LET V(R-1,S)=2
802 LET R=R-1
810 IF C=H*V+1 THEN 1010
811 LET Q=0
812 GO TO 260
820 LET W(R,S-1)=C
830 LET C=C+1
840 LET V(R,S-1)=1
841 LET S=S-1
842 IF C=H*V+1 THEN 1010
850 LET Q=0
851 GO TO 260
860 LET W(R+1,S)=C
870 LET C=C+1
871 IF V(R,S)=0 THEN 880
872 LET V(R,S)=3
873 GO TO 890
880 LET V(R,S)=2
890 LET R=R+1
900 IF C=H*V+1 THEN 1010
902 GO TO 530
910 IF Q=1 THEN 960
920 LET W(R,S+1)=C
921 LET C=C+1
922 IF V(R,S)=0 THEN 940
930 LET V(R,S)=3
931 GO TO 950
940 LET V(R,S)=1
950 LET S=S+1
951 IF C=H*V+1 THEN 1010
952 GO TO 260
960 LET Z=1
970 IF V(R,S)=0 THEN 980
971 LET V(R,S)=3
972 LET Q=0
973 GO TO 1000
980 LET V(R,S)=1
981 LET Q=0
982 LET R=1
990 LET S=1
991 GO TO 250
1000 GO TO 210
1010 FOR J=1 TO V
1011 PRINT"I";
1012 FOR I=1 TO H
1013 IF V(I,J)<2 THEN 1030
1020 PRINT" ";
1021 GO TO 1040
1030 PRINT" I";
1040 NEXT I
1041 PRINT
1043 FOR I=1 TO H
1045 IF V(I,J)=0 THEN 1060
1050 IF V(I,J)=2 THEN 1060
1051 PRINT": ";
1052 GO TO 1070
1060 PRINT ":--";
1070 NEXT I
1071 PRINT":"
1072 NEXT J
1073 END