home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
ENTERPRS
/
C64
/
GAMES
/
CRAZY-8S.C64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2000-06-30
|
4KB
|
159 lines
10 REM*CRAZY 8'S BY JOHN O'HARE (PET)
15 REM*CONVERTED TO THE C64 BY ROGER D. BURGE
20 REM*#2667, TORONTO PET USERS GROUP INC., CANADA
25 QC=211:QL=214:QK=158:QP=151
30 PRINT"[147]":POKE53280,1:POKE53281,1
35 A$="CRAZY EIGHT'S"
40 GOSUB665
45 S$="[193][211][218][216]8[166][214].":C$=" A 2 3 4 5 6 7 8 9 10J Q K "
50 A$="BY":GOSUB665
55 A$="JOHN O'HARE"
60 GOSUB665:PRINT" COMMODORE 64 VERSION BY ROGER D. BURGE"
65 DIMC(52)
70 DIM P1(50),P2(50)
75 DIM P3(50)
80 DATA SPADES,8,HEARTS,21,DIAMONDS,34,CLUBS,47
85 FORI=1TO4:READSU$(I),SU(I):NEXT
90 FORF=1TO8
95 A=INT(RND(1)*8)+1:X=ASC(MID$(S$,A,1))
100 POKEQL,INT(RND(1)*12)+5:PRINT:POKEQC,INT(RND(1)*37)+1:GOSUB650:NEXT
105 POKEQL,22:PRINT:POKEQC,12
110 GOSUB715:GOSUB545
115 W=1
120 FORI=1TO14STEP2:P1=P1+1:P2=P2+1:P1(P1)=C(I):P2(P2)=C(I+1):NEXT
125 C1=P1+P2+W
130 TC=C(C1):Z=TC:PRINT"[147]";
135 GOSUB465:GOSUB450
140 POKEQL,14:PRINT:POKEQC,.:INPUT"CARD TO PLAY [191] [157][157][157][157][157]";P$
145 IFP$="Q"THEN680
150 P=VAL(P$):IFP=.ANDP$<>"D"THENPRINT"[145][145]":GOTO140
155 IFP$<>"D"THEN175
160 C1=P1+P2+W:P1=P1+1:IFC1+1>52THENP1=P1-1:GOTO250
165 P1(P1)=C(C1+1)
170 GOTO135
175 IFP>P1THENPRINT"[145][145]":GOTO140
180 Z=P1(P):GOSUB535
185 S7=S:C7=C:Z=TC:GOSUB535
190 IFS7<>SANDC7<>CANDC7<>8THENPRINT"[145][145]":GOTO140
195 IFC7<>8THEN235
200 INPUT"WHAT SUIT DO YOU DECLARE [191][157][157][157]";U$:U$=LEFT$(U$,1)
205 IFU$<>"[193]"ANDU$<>"[211]"ANDU$<>"[218]"ANDU$<>"[216]"THENPRINT"[145][145]":GOTO200
210 IFU$="[193]"THENTC=8
215 IFU$="[211]"THENTC=8+13
220 IFU$="[218]"THENTC=8+13+13
225 IFU$="[216]"THENTC=8+13+13+13
230 GOTO 240
235 TC=P1(P)
240 W=W+1
245 P1(P)=P1(P1):P1=P1-1
250 PRINT"[145][145]":PRINT" "
255 GOSUB465:GOSUB450
260 POKEQL,14:PRINT:POKEQC,.:PRINT" "
265 Z=TC:GOSUB535:S7=S:C7=C
270 NS=.:FORI=1TOP2:Z=P2(I):GOSUB535:IFS=S7THENNS=NS+1
275 NEXT
280 FORI=1TOP2
285 Z=P2(I):GOSUB535
290 IFC=8THENP3(I)=-2:GOTO310
295 IFC=C7THENP3(I)=NS:GOTO310
300 IFS=S7THENGOSUB360:GOTO310
305 P3(I)=.
310 NEXT
315 SC=-3:PL=.:FORI=1TOP2:IFP3(I)>SCANDP3(I)<>.THENSC=P3(I):PL=I
320 NEXT
325 IFSC=-3THEN420
330 IFSC=-2THEN375
335 POKEQL,14:PRINT:POKEQC,.
340 PRINT"I PLAY ";:Z=P2(PL):GOSUB535:PRINTMID$(C$,C*2,2);MID$(S$,S,1)
345 TC=P2(PL):P2(PL)=P2(P2):P2=P2-1:W=W+1
350 FORD=1TO750:NEXT:PRINT"[145][145]":PRINT" "
355 GOTO135
360 P3(I)=.:CT=.:S8=S:FORJ=1TOP2:Z=P2(J):GOSUB535
365 IFS8=STHENP3(I)=P3(I)+1
370 NEXT:RETURN
375 FORS9=1TO4:CT(S9)=.:FORI=1TOP2:Z=P2(I):GOSUB535
380 IFS=S9ANDC<>8THENCT(S9)=CT(S9)+1
385 NEXT:NEXT
390 P7=.:CT=-1:FORI=1TO4:IFCT(I)>CTTHENCT=CT(I):P7=I
395 NEXT
400 POKEQL,14:PRINT:POKEQC,.:PRINT"I DECLARE ";SU$(P7)" AS SUIT."
405 FORD=1TO750:NEXT
410 PRINT"[145][145]":PRINT" "
415 TC=SU(P7):P2(PL)=P2(P2):P2=P2-1:W=W+1:GOTO135
420 POKEQL,14:PRINT:POKEQC,.
425 C1=P1+P2+W:IFC1+1>52THENPRINT"I CAN'T PLAY":FORD=1TO750:NEXT:PRINT"[145][145]"
430 IFC1+1>52THENPRINT" ":GOTO135
435 PRINT"I DRAW A CARD"
440 FORD=1TO500:NEXT:PRINT"[145][145]":PRINT" ":P2=P2+1:P2(P2)=C(C1+1)
445 GOTO280
450 Z=TC:GOSUB535
455 POKEQL,16:PRINT:POKEQC,30:PRINT"TOP CARD[146]"
460 POKEQL,18:PRINT:POKEQC,32:GOSUB600:PRINT"":RETURN
465 PRINT"";
470 C1=P1+P2+W
475 PRINT"CARDS LEFT -";52-C1;"[157] ";
480 PRINT"IN MY HAND";P2"[157] "
485 IFP2=.THENPRINT"---YOUR 64 WINS!!!---":GOTO680
490 IFP1=.THENPRINT"---YOU WIN!!!!---":GOTO680
495 PRINT:FORI=1TOP1
500 I$=MID$(STR$(I),2)
505 Z=P1(I):GOSUB535:GOSUB670:PRINTI$"-";MID$(C$,C*2,2);MID$(S$,S,1)"[146] ";
510 IFPOS(.)>33THENPRINT:PRINT
515 NEXT:PRINT" ":PRINT
520 POKEQL,20:PRINT:POKEQC,.:PRINT"[144] JOHN O'HARE "
525 PRINT" CRAZY 8'S [144] [146]
530 [153]" ROGER BURGE WAIT":[142]
535 S[178][181]((Z[171]1)[173]13)[170]1
540 C[178](Z[170]13)[171]S[172]13 :[142]
545 [153]"SHUFFLING...."
550 [129]I[178]1[164]52
555 C(I)[178]I
560 [130]I
565 [129]I[178]1[164]52
570 J[178][181]([187](1)[172]52)[170]1
575 TEMP[178]C(J)
580 C(J)[178]C(I)
585 C(I)[178]TEMP
590 [130]I
595 [142]
600 [139]S[178]1[176]S[178]4[167][151]646,.:[137]610
605 [151]646,2
610 [153]"";[202](C$,C[172]2,2);" ";"CMDCMDCMD";
615 [153]" WAIT";"CMDCMDCMD";
620 [153]" ";[202](S$,S,1);" WAIT";"CMDCMDCMD";
625 [153]" WAIT";"CMDCMDCMD";
630 [139]C[178]10[167]640
635 [153]" ";[202](C$,C[172]2,1):[137]645
640 [153]" 10WAIT"
645 [151]646,6:[142]
650 [129]I[178]1[164]3:[153][199](X);:[130]:[153]"CMDCMDCMD";[199](X);" ";[199](X);"CMDCMDCMD";
655 [129]I[178]1[164]3:[153][199](X);:[130]:[153]"CMDCMDCMD";[199](X)" ";[199](X);"CMDCMDCMD";
660 [129]I[178]1[164]3:[153][199](X);:[130]:[153]:[142]
665 [153][163]20[171][195](A$)[173]2);A$:[142]
670 [139]S[178]2[176]S[178]3[167][151]646,2:[142]
675 [151]646,.:[142]
680 [139]P$[178]"Q"[175]C1[178]52[167][153]"---IT'S A TIE!!!---"
685 [153]" PLAY AGAIN? (Y/N) ":[151]198,.
690 [161]A$:[139]A$[178]"Y"[167][138]
695 [139]A$[178]"N"[167]705
700 [137]690
705 [151]53280,3:[153]"LOAD":[128]
715 [153]"CMDCMDNEED INSTRUCTIONS? (Y/N)":[151]198,.
720 [161]K$:[139]K$[178]"Y"[167]735
725 [139]K$[178]"N"[167][153]"LOAD":[142]
730 [137]720
735 [153]"LOAD"[166]15)" CRAZY 8'S "
740 [153]"PLAY THE CARD GAME CRAZY 8'S AGAINST YOUR 64.
745 PRINT"YOUR 64 WILL PROMPT YOU THROUGH THE GAME.
750 [153]"IF YOU DON'T HAVE A CARD IN YOUR HAND YOU CAN PLAY THEN ENTER DWAIT";
755 [153]" (FOR 'DRAW CARD') WHEN ASKED WHICH CARD TO PLAY.
760 PRINT"IF THERE ARE NO CARDS LEFT IN THE DECK THEN YOUR 64 WILL TAKE A TURN.
765 [153]"IF YOU OR YOUR 64 CANNOT PLAY AND THEREARE NO CARDS LEFT ";
770 [153]"THEN ENTER QWAIT AND A TIEWILL BE DECLARED.
775 PRINT"ENTER Q[146] ANYTIME TO END THE GAME.
780 [153]"WHEN YOU PLAY AN '8' YOU WILL BE ASKED TO DECLARE A SUIT. ENTER ";
785 [153]"ATN (null) (null) OR (null) AS YOUR CHOICE MAY BE.
790 PRINT" PRESS ANY KEY TO PLAY. ":POKE198,.
795 GETK$:IFK$=""THEN795
800 PRINT"[147]":RETURN