mirror of
https://github.com/SweepingDeveloper/Apple-II_DOND.git
synced 2025-01-20 02:30:58 +00:00
Create code.txt
NO REAL MONEY NOR PRIZES ARE AWARDED. THIS IS JUST A COMPUTER PROGRAM. Deal or No Deal is owned by Endemol. No ownership is implied. The source code. Press SHIFT + INSERT in AppleWin to copy the program to the emulator. Then type "SAVE DOND", then "RUN" it.
This commit is contained in:
commit
ea506d7b5c
178
code.txt
Normal file
178
code.txt
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
10 DIM V(26): DIM CV(26)
|
||||||
|
20 DIM CTG(9): DIM CA(26): DIM VA(26)
|
||||||
|
22 DIM OM(9)
|
||||||
|
23 RS = 0:CO = 1
|
||||||
|
25 R = 1:D = 0: DIM RO(9)
|
||||||
|
30 FOR A = 0 TO 25
|
||||||
|
40 CA(A) = 1:VA(A) = - 1
|
||||||
|
50 READ V(A): REM CASE VALUES
|
||||||
|
60 NEXT A
|
||||||
|
70 FOR A = 0 TO 25
|
||||||
|
75 PRINT "LOADING CASE #";A + 1
|
||||||
|
80 VC = INT ( RND (1) * 26)
|
||||||
|
90 IF VA(VC) = - 1 THEN CV(A) = VC
|
||||||
|
100 IF VA(VC) < > - 1 THEN GOTO 80
|
||||||
|
110 VA(VC) = 1: NEXT A
|
||||||
|
115 IF RS = 1 THEN RS = 0: GOTO 200
|
||||||
|
120 FOR A = 0 TO 8: READ CTG(A): NEXT A
|
||||||
|
130 FOR A = 0 TO 8: READ OM(A): NEXT A
|
||||||
|
140 FOR A = 0 TO 8: PRINT OM(A): NEXT A
|
||||||
|
200 REM *** DRAW SCREEN FROM START ***
|
||||||
|
210 HOME
|
||||||
|
220 FOR A = 0 TO 12
|
||||||
|
225 VTAB 1 + A: HTAB 8 - LEN ( STR$ (V(A)))
|
||||||
|
230 IF VA(A) = 1 THEN PRINT "$";V(A)
|
||||||
|
235 VTAB 1 + A: HTAB 40 - LEN ( STR$ (V(A + 13)))
|
||||||
|
240 IF VA(A + 13) = 1 THEN PRINT "$";V(A + 13)
|
||||||
|
250 NEXT A
|
||||||
|
300 REM *** DRAW CASES ***
|
||||||
|
310 FOR A = 0 TO 12
|
||||||
|
320 VTAB 15: HTAB A * 3 + 1
|
||||||
|
330 IF CA(A) = 1 AND A + 1 < 10 THEN PRINT " ";A + 1
|
||||||
|
340 IF CA(A) = 1 AND A + 1 > 9 THEN PRINT A + 1
|
||||||
|
350 VTAB 16: HTAB A * 3 + 1
|
||||||
|
360 IF CA(A + 13) = 1 THEN PRINT A + 14
|
||||||
|
370 NEXT A
|
||||||
|
380 VTAB 18: HTAB 2: INPUT "PICK A CASE >";CTP
|
||||||
|
400 CA(CTP - 1) = 0
|
||||||
|
500 REM *** GAME LOOP ***
|
||||||
|
510 HOME
|
||||||
|
520 FOR A = 0 TO 12
|
||||||
|
525 VTAB 1 + A
|
||||||
|
526 IF VA(A) = 0 THEN HTAB 1: PRINT " "
|
||||||
|
530 IF VA(A) = 1 THEN HTAB 8 - LEN ( STR$ (V(A))): PRINT "$";V(A)
|
||||||
|
534 VTAB 1 + A
|
||||||
|
535 IF VA(A + 13) = 0 THEN HTAB 32: PRINT " "
|
||||||
|
540 IF VA(A + 13) = 1 THEN HTAB 40 - LEN ( STR$ (V(A + 13))): PRINT "$";V(A + 13)
|
||||||
|
550 NEXT A
|
||||||
|
600 REM *** DRAW CASES AGAIN ***
|
||||||
|
610 FOR A = 0 TO 12
|
||||||
|
620 VTAB 15: HTAB A * 3 + 1
|
||||||
|
630 IF CA(A) = 1 AND A + 1 < 10 THEN PRINT " ";A + 1
|
||||||
|
640 IF CA(A) = 1 AND A + 1 > 9 THEN PRINT A + 1
|
||||||
|
645 IF CA(A) = 0 THEN PRINT ".."
|
||||||
|
650 VTAB 16: HTAB A * 3 + 1
|
||||||
|
660 IF CA(A + 13) = 1 THEN PRINT A + 14
|
||||||
|
665 IF CA(A + 13) = 0 THEN PRINT ".."
|
||||||
|
670 NEXT A
|
||||||
|
700 VTAB 18: HTAB 2: PRINT "ROUND ";R;": ";CTG(R - 1);" CASES TO GO"
|
||||||
|
705 IF CTG(R - 1) = 0 THEN GOTO 800
|
||||||
|
710 VTAB 19: HTAB 2: INPUT "PICK A CASE TO ELIMINATE: ";CE
|
||||||
|
715 IF CE = 0 THEN GOTO 510
|
||||||
|
720 IF CE < 1 OR CE > 26 OR CA(CE - 1) = 0 THEN GOTO 710
|
||||||
|
730 VTAB 3: HTAB 11
|
||||||
|
735 PRINT "........": VTAB 3: HTAB 11
|
||||||
|
740 PRINT "$";V(CV(CE - 1))
|
||||||
|
750 CA(CE - 1) = 0
|
||||||
|
755 VA(CV(CE - 1)) = 0
|
||||||
|
760 CTG(R - 1) = CTG(R - 1) - 1
|
||||||
|
770 IF CTG(R - 1) > - 1 THEN GOTO 520
|
||||||
|
800 REM *** BANK OFFER ***
|
||||||
|
810 FOR A = 18 TO 19: VTAB A: HTAB 1: FOR B = 1 TO 40: PRINT " ";: NEXT B: NEXT A
|
||||||
|
820 IF D > 0 THEN VTAB 18: HTAB 2: PRINT "THE BANK WOULD HAVE OFFERED YOU": GOTO 835
|
||||||
|
830 VTAB 18: HTAB 2: PRINT "THE BANK WISHES TO BUY YOUR CASE FOR"
|
||||||
|
835 VT = 0:CC = 0
|
||||||
|
840 FOR A = 0 TO 25
|
||||||
|
850 IF VA(A) = 1 THEN VT = VT + V(A):CCC = CC + 1
|
||||||
|
860 VTAB 19: HTAB 2: PRINT "$ ": VTAB 19: HTAB 2: PRINT "$"; INT (VT)
|
||||||
|
870 NEXT A
|
||||||
|
880 VT = VT / CC
|
||||||
|
890 VTAB 19: HTAB 2: PRINT "$ ": VTAB 19: HTAB 2: PRINT "$"; INT (VT)
|
||||||
|
900 O = INT (VT * OM(R - 1))
|
||||||
|
904 O = O * (1 + ( INT ( RND (1) * 40) - 20) / 100)
|
||||||
|
905 IF O > 9999 THEN O = INT (O / 1000) * 1000
|
||||||
|
906 IF O > 999 AND O < 10000 THEN O = INT (O / 100) * 100
|
||||||
|
907 RO(R - 1) = O
|
||||||
|
910 VTAB 19: HTAB 2: PRINT "$ ": VTAB 19: HTAB 2: PRINT "$";O
|
||||||
|
915 IF D > 0 THEN GOTO 921
|
||||||
|
920 VTAB 20: HTAB 2: PRINT "(D)EAL OR (N)O DEAL?"
|
||||||
|
921 FOR A = 0 TO R - 1
|
||||||
|
922 VTAB 2 + A: HTAB 25
|
||||||
|
923 IF D = A + 1 THEN INVERSE
|
||||||
|
924 IF D < > A + 1 THEN NORMAL
|
||||||
|
925 PRINT "$";RO(A)
|
||||||
|
926 NEXT A
|
||||||
|
927 NORMAL
|
||||||
|
928 IF D > 0 THEN FOR X = 1 TO 1000: NEXT X: GOTO 950
|
||||||
|
930 GET PAK$: IF PAK$ < > "D" AND PAK$ < > "N" AND PAK$ < > "C" THEN GOTO 970
|
||||||
|
940 IF PAK$ = "D" AND D = 0 THEN D = R
|
||||||
|
945 IF PAK$ = "C" AND CO = 1 THEN GOTO 4000
|
||||||
|
950 R = R + 1
|
||||||
|
955 IF R = 10 THEN GOTO 2000
|
||||||
|
960 FOR A = 17 TO 20: VTAB A: HTAB 1: FOR B = 1 TO 40: PRINT " ";: NEXT B: NEXT A
|
||||||
|
970 GOTO 520
|
||||||
|
1000 DATA 1,2,5,10,25,50,75,100,200,300,400,500,750,1000,5000,10000,25000,50000,75000,100000,200000,300000,400000,500000,750000,1000000
|
||||||
|
1010 DATA 6,5,4,3,2,1,1,1,1
|
||||||
|
1020 DATA .15,.30,.65,.80,.90,.95,1,1,1
|
||||||
|
2000 REM *** END OF GAME ***
|
||||||
|
2005 IF D > 0 THEN GOTO 3000
|
||||||
|
2010 FOR A = 17 TO 21: VTAB A: HTAB 1: FOR B = 1 TO 40: PRINT " ";: NEXT B: NEXT A
|
||||||
|
2020 CR = 0
|
||||||
|
2030 FOR A = 0 TO 25
|
||||||
|
2032 IF CA(A) = 1 THEN CR = A
|
||||||
|
2034 NEXT A
|
||||||
|
2040 VTAB 18: HTAB 2: PRINT "ONE FINAL DECISION."
|
||||||
|
2050 VTAB 19: HTAB 2: PRINT "YOU CAN EITHER HAVE YOUR CASE, ";CTP;"..."
|
||||||
|
2060 VTAB 20: HTAB 2: PRINT "(PRESS ANY KEY)"
|
||||||
|
2070 GET PAK$
|
||||||
|
2080 FOR A = 17 TO 23: VTAB A: HTAB 1: FOR B = 1 TO 40: PRINT " ";: NEXT B: NEXT A
|
||||||
|
2090 VTAB 18: HTAB 2: PRINT "OR YOU CAN SWAP IT WITH CASE # ";CR + 1;"."
|
||||||
|
2100 VTAB 20: HTAB 2: PRINT "(PRESS ANY KEY)"
|
||||||
|
2110 GET PAK$
|
||||||
|
2120 FOR A = 17 TO 23: VTAB A: HTAB 1: FOR B = 1 TO 40: PRINT " ";: NEXT B: NEXT A
|
||||||
|
2130 VTAB 18: HTAB 2: PRINT "<S>WAP OR <N>O SWAP?"
|
||||||
|
2140 GET PAK$
|
||||||
|
2150 IF PAK$ < > "S" AND PAK$ < > "N" THEN GOTO 2140
|
||||||
|
2160 IF PAK$ = "S" THEN SN = 1
|
||||||
|
2170 IF PAK$ = "N" THEN SN = 0
|
||||||
|
2180 IF SN = 1 THEN CTP = CR + 1
|
||||||
|
3000 HOME
|
||||||
|
3010 VTAB 2: HTAB 2
|
||||||
|
3020 IF D = 0 THEN PRINT "YOU HOLD CASE # ";CTP;"."
|
||||||
|
3030 IF D > 0 THEN PRINT "YOU MADE A DEAL FOR $";RO(D - 1);"."
|
||||||
|
3040 FOR A = 1 TO 1000: NEXT A
|
||||||
|
3050 VTAB 10: HTAB 2: PRINT "YOUR CASE CONTAINS..."
|
||||||
|
3060 VTAB 12: HTAB 2: PRINT "/--------\"
|
||||||
|
3070 VTAB 13: HTAB 2: PRINT "[########]"
|
||||||
|
3075 IF CTP < 10 THEN VTAB 13: HTAB 7
|
||||||
|
3076 IF CTP > 9 THEN VTAB 13: HTAB 6
|
||||||
|
3077 PRINT CTP
|
||||||
|
3080 VTAB 14: HTAB 2: PRINT "\--------/"
|
||||||
|
3090 FOR A = 1 TO 2000: NEXT A
|
||||||
|
3100 VTAB 13: HTAB 2: PRINT "[ ]"
|
||||||
|
3120 FOR A = 1 TO 100: NEXT A
|
||||||
|
3130 VTAB 13: HTAB 3: PRINT "$";V(CV(CTP - 1))
|
||||||
|
3140 FOR A = 1 TO 1000: NEXT A
|
||||||
|
3150 VTAB 18: HTAB 2: PRINT "PLAY AGAIN?"
|
||||||
|
3160 VTAB 19: HTAB 2: PRINT "<Y>ES OR <N>O"
|
||||||
|
3170 GET PAK$
|
||||||
|
3180 IF PAK$ < > "Y" AND PAK$ < > "N" THEN GOT3170
|
||||||
|
3190 IF PAK$ = "Y" THEN GOTO 3210
|
||||||
|
3200 IF PAK$ = "N" THEN END
|
||||||
|
3210 FOR A = 0 TO 25
|
||||||
|
3220 CA(A) = 1:VA(A) = - 1:R = 1:D = 0
|
||||||
|
3230 IF A < 10 THEN RO(A) = 0
|
||||||
|
3240 NEXT A
|
||||||
|
3250 RS = 1
|
||||||
|
3260 CTG(0) = 6:CTG(1) = 5:CTG(2) = 4:CTG(3) = 3:CTG(4) = 2
|
||||||
|
3270 FOR A = 5 TO 8:CTG(A) = 1: NEXT A
|
||||||
|
3280 GOTO 70
|
||||||
|
4000 REM *** COUNTER OFFER ***
|
||||||
|
4005 IF CO = 1 THEN CO = 0
|
||||||
|
4010 VTAB 20: HTAB 2: PRINT " "
|
||||||
|
4020 VTAB 20: HTAB 2: INPUT "HOW MUCH? >";COO
|
||||||
|
4030 PO = 1 + ( INT ( RND (1) * 15) + 15) / 100
|
||||||
|
4040 IF COO > 0 AND COO > ( INT (VT * OM(R - 1))) * PO THEN GOTO 4100
|
||||||
|
4050 VTAB 21: HTAB 2: PRINT "THE BANKER SAYS..."
|
||||||
|
4060 FOR A = 1 TO 1000: NEXT A
|
||||||
|
4070 VTAB 21: HTAB 2: PRINT "DEAL."
|
||||||
|
4075 FOR A = 1 TO 3000: NEXT A
|
||||||
|
4076 VTAB 21: HTAB 2: PRINT " "
|
||||||
|
4080 D = R:RO(R - 1) = COO
|
||||||
|
4090 GOTO 950
|
||||||
|
4100 VTAB 21: HTAB 2: PRINT "THE BANKER SAYS..."
|
||||||
|
4110 FOR A = 1 TO 1000: NEXT A
|
||||||
|
4120 VTAB 21: HTAB 2: PRINT "NO DEAL. "
|
||||||
|
4125 FOR A = 1 TO 3000: NEXT A
|
||||||
|
4126 VTAB 21: HTAB 2: PRINT " "
|
||||||
|
4130 GOTO 950
|
Loading…
x
Reference in New Issue
Block a user