$LINESIZE:1326 ----------------------------------------------------------------------<i( The Game of Klondyke Solitar2 By: Jeff Littlefield< For: the IBM PC and the Color Graphics CardFP FOR PUBLIC USE MAY NOT BE SOLD)Z ALL RIGHTS RESERVED/d{n ---------------------------------------------------------------------x AZFALSE:TRUE FALSE : ABORT FALSE : WON FALSE DECK$(4), STACK$(,),CARD$(4),TOP$(),STACKPTR(),VISIPTR(),XYARR$(R)#NOT.READTRUEA : () : () k(((,,))(((,,))<)) ,,,: ,,::"Pardon me while I shuffle the deck." * : :SET UP THE HELP SCREEN " :SHUFFLE THE DECK9 : :PRINT OUT THE PLAYING TABLEIWON FALSES q FLAG t : ABORT ABORT FALSE : FLAG: :ASK IF THEY WANT TO PLAY AGAIN ABORT ABORT FALSE : : FLAG : : ,,::$"B, I 4: CARD$(I): IW6 I 4 @ X(()I) :PICK NUMBER FROM 1 TO IJ DECK$(I)CARD$(X) :PICK THAT CARD OUT OF THE PILET CARD$(X)CARD$(I) :MOVE LAST CARD TO WHERE PREVIOUS ONE WAS&^ IVhX :DECK COUNTERr I :NUMBER OF STACKS| J I :NUMBER OF CARDS IN THAT STACK STACK$(I,J)DECK$(X) :ASSIGN CARDS TO STACK XX Jd STACKPTR(I)I :SET STACKPTR(I) TO LAST CARD IN EACH STACK VISIPTR(I)I :SAME WITH VISIPTR(I) IDECKPTR:ENDDECK4:DECK$()" ":NC'" AH"," 2H"," 3H"," 4H"," 5H"," 6H"," 7H"," 8H"," 9H","10H"," JH"," QH"," KH"z" AD"," 2D"," 3D"," 4D"," 5D"," 6D"," 7D"," 8D"," 9D","10D"," JD"," QD"," KD"" AC"," 2C"," 3C"," 4C"," 5C"," 6C"," 7C"," 8C"," 9C","10C"," JC"," QC"," KC" " AS"," 2S"," 3S"," 4S"," 5S"," 6S"," 7S"," 8S"," 9S","10S"," JS"," QS"," KS". I F STACK$(I,)" "N I\ I p TOP$(I)" "x& I~0: , : ,:"TOP:": ,A: "Time: "D ,:"STACKS:"N I X ,(-(I))b I;l Iv , I ! JI < (I),(-(J)) VISIPTR(J)I C$STACK$(J,I): n
: STACK$(J,I);: , : X : ();: X J I ,
,5:"PILE:"; ,4
,;:C$DECK$(DECKPTR): n
: DECK$(DECKPTR);: ,:
,A:"Count: ";: : NC;: d ,@:"Card #: ";: : DECKPTR;" "; : ,2:"COMMAND: __ "; ,:"Press F1 for a list of Commands"; ,; * ,,,4>
,
:"C Claim Victory"3H ,
:"N New Card on Pile"gR ,
:"P# Card on Pile to Specified Stack"\
,
:"PT Card on Pile to Top"f ,
:"## Visible Cards on Stack to New Specified Stack"p ,
:"#T Bottom Card on Specified Stack to Top"$z ,
:"Q Quit"H ,
:"F1 For This Screen" : ,
:"Esc Abort End and Return to Present Game : ,:"Press Any Key To Continue": ,,, ,,,A$: A$"" : FLAG: h: FLAG 3 ,;:"__ ";: ,;jK$: K$"" ,G: ;: ,;: : K$; K$"N" K$"n" $ K$"P" K$"p" t K$"1" K$"7" K$"Q" K$"q" FLAG: K$"C" K$"c" 2,: 7 $ DECKPTRENDDECK DECKPTRH .XENDDECK{ 8 X DECKPTRENDDECK : DECKPTRDECKPTR B
,; LC$DECK$(DECKPTR): n
: DECK$(DECKPTR): , V ,H: DECKPTR;" "; ` !jK$: K$"" j : K$;:!t jR!~(K$"t" K$"T") (K$"1" K$"7") : 2,: h!W$DECK$(DECKPTR)!SUIT$(W$,,):SIZE$(W$,,)! K$"T" K$"t" P: !K(K$)!W1$STACK$(K,STACKPTR(K)) "SUITST$(W1$,,):SIZEST$(W1$,,)3"FLAG: : FLAG 2, : Q"STACKPTR(K)STACKPTR(K)n"STACK$(K,STACKPTR(K))W$" STACKPTR(K),(-(K)):C$W$: n
: W$: ,"DECKPTRDECKPTR: #
,;: DECKPTR C$DECK$(DECKPTR): n
: DECK$(DECKPTR): , : " "3# ,H: DECKPTR;" ";=#
[# DECKPTRENDDECK <x# I DECKPTR ENDDECK#(DECK$(I)DECK$(I)#2 I#<ENDDECKENDDECK:NCNC:
,H: NC;#F#P SUIT$"C" N: x$Z SUIT$"D" N: x$d SUIT$"H" N: x&$nNB$xSIZEST$(TOP$(N),,)k$FLAG: : FLAG 2,: $TOP$(N)W$: ,
(
(N)):C$W$: n
: W$: ,:$(SUIT$"H" SUIT$"D")(SUITST$"H" SUITST$"D") %(SUIT$"C" SUIT$"S")(SUITST$"C" SUITST$"S") 1% SIZE$"9" U% SIZE$"0" SIZEST$"J" y% SIZE$"9" SIZEST$"0" % ((SIZEST$)(SIZE$)) % SIZE$"A" SIZEST$"2" % SIZE$"J" SIZEST$"Q" & SIZE$"Q" SIZEST$"K" /& SIZE$"K" SIZEST$" " 5&B&FLAG:f& SIZE$"A" SIZEST$" " ^& SIZE$"2" SIZEST$"A" ^&" SIZE$"0" SIZEST$"9" ^&, ((SIZE$)(SIZEST$)) ^&6 SIZE$"J" SIZEST$"0" ^'@ SIZE$"Q" SIZEST$"J" ^@'J SIZE$"K" SIZEST$"Q" ^F'TS'^FLAG:{'h CHECK TO SEE IF THE GAME IS OVER'r I '| (TOP$(I),,)"K" ' I' GAME OVER AND PLAYER WON'FLAG:( STACK TO STACK MOVE OR STACK TO TOP(STKNUM1(K$)#( jW( (K$"1" K$"7") (K$"T" K$"t") h( 2,: ( K$"t" K$"T" W$STACK$(STKNUM1,STACKPTR(STKNUM1)): (W$STACK$(STKNUM1,VISIPTR(STKNUM1))(SUIT$(W$,,)(SIZE$(W$,,)!) K$"T" K$"t" P: 4)STKNUM2(K$)])W$STACK$(STKNUM2,STACKPTR(STKNUM2))t)SUITST$(W$,,))&SIZEST$(W$,,))0FLAG: ): FLAG 2,: )D VISIPTR(STKNUM1) VISIPTR(STKNUM1)*N IVISIPTR(STKNUM1) STACKPTR(STKNUM1)=*XSTACKPTR(STKNUM2)STACKPTR(STKNUM2)^*b I,-(STKNUM1):" ";*lSTACK$(STKNUM2,STACKPTR(STKNUM2))STACK$(STKNUM1,I)*v STACKPTR(STKNUM2),-(STKNUM2)*C$ STACK$(STKNUM2,STACKPTR(STKNUM2)): n
+ STACK$(STKNUM2,STACKPTR(STKNUM2));: ,(+ Ig+ VISIPTR(STKNUM1) VISIPTR(STKNUM1)VISIPTR(STKNUM1)+STACKPTR(STKNUM1)VISIPTR(STKNUM1)+ STACKPTR(STKNUM1) + STACKPTR(STKNUM1),-(STKNUM1) ,C$ STACK$(STKNUM1,STACKPTR(STKNUM1)): n
8, STACK$(STKNUM1,STACKPTR(STKNUM1));: ,B, k, STACKPTR(STKNUM1),-(STKNUM1)w," ";, STACKPTR(STKNUM1)VISIPTR(STKNUM1) ,STACKPTR(STKNUM1)STACKPTR(STKNUM1), , PRINT OUT THE TABLE- : SEEN FALSEV-* ,:"Would you like to see the cards? "; : ,: : ,m-4A$: A$"" 4-> A$() ABORTTRUE : ,: (();: : :: ABORTFALSE-H A$"y" A$"Y" A$"N" A$"n" 2,: 4
.R A$"N" A$"n" Q.\SEEN TRUE : ,: " ";d.f I l.pX.z VISIPTR(I)X. X,-(I). STACK$(I,X);:XX.. I. ,2:"Pile: ".X:RR. I ENDDECK/ X8L RRRR:X/ RR,X8L/ DECK$(I)" " : DECK$(I);:XXT/ I\/ b/j/ / SCR.WIDTH( SCR.WIDTH P: ,:"Play Again?";: $ : ,/ ,:" Do you want to play again? ";0$ A$: A$"" $ $0. WON q08 A$() V : SEEN WON ABORTTRUE : ,: ();:0= WON 2,: $ 0B 2,: ,:"Cheater... Shame Shame! You've already seen the cards!";:DT!:
1L , : (<);: .1V A$"y" A$"Y" 6:FLAG :N1` A$"N" A$"n" 6:_1j 2,: $ i1t
o1~ 1 :CHECK TO SEE IF CLAIMED VICTORY1 FLAG1 NC 1 I 1 VISIPTR(I) 1 I1 FLAG: 2 2,: ,2:"You Have Not Won Yet!!!"62 DT! :
J2 ,2: );T2 2 :DELAY TIME ROUTINE FOR (DT!) MILLISECONDS2
DT!2
DV!DT!2
SEG @2
DV!2(
A! O22
ID O 3<
A! A! (oID)3F
IDC3P
A! AOLD! DV! DV! : AOLD! A!I3Z
W3d
SEG : i3n
C$(C$,,)3x
C$"H" C$"D" , : ,3
3
'DISPLAY WON SCREEN'3
NOT.READ I R : XYARR$(I) : : NOT.READFALSE4
, : ,4
I R ,4
J -Y4
X()@:Y():CC: C Cg4
(X,Y),Co4
J4
LL (()I)4
XYPOS$XYARR$(LL)4
XYARR$(LL)XYARR$(I)4Y ((XYPOS$,))4X ((XYPOS$,))4 Y,X: "*";5" I#5,SCR.WIDTH( : WON TRUE : 856 ,,,: P:{5@ "002","006","009","010","011","014","018","023","027","030"5J "031","032","035","039","103","105","108","112","114"5T "118","123","127","129","133","135","136","139","204","208">6^ "212","214","218","223","225","227","229","233","235","236"6h "237","239","304","308","312","314","318","323","325","327"6r "329","333","335","337","338","339","404","408","412","414"7| "418","423","425","427","429","433","435","438","439","504"J7 "509","510","511","515","516","517","524","526","530","531"c7 "532","535","539"