home *** CD-ROM | disk | FTP | other *** search
- 10 rem *** spectrum by donna k. woody 7-18-84 ***
- 15 poke783,peek(783)and254:f=54272:pokef+24,8:pokef+6,0:pokef+1,255:pokef+4,8
- 20 gosub40000:gosub20000
- 30 gosub20200:goto9000
- 98 :
- 99 rem *** update source & drop piles ***
- 100 cd=cd-1:c$(sp,0,0)=str$(cd):rem remove card from source pile
- 110 lf=lf+1:rem inc drop pile
- 120 c$(dp,0,0)=str$(lf):c$(dp,lf,0)=c$(sp,cd+1,0):return:rem transfer card
- 148 :
- 149 rem *** print source card ***
- 150 ifqf=1thenreturn
- 155 xp=sp:xc=cd:gosub200:q$=ca$:gosub5000
- 160 q=q+1:w=w+1:q$=c$(sp,cd,0):gosub5000:gosub300:return
- 198 :
- 199 rem *** get position to update card ***
- 200 q1=val(p$(xp,1)):w1=val(p$(xp,0)):rem read q & w start positions
- 210 q2=val(p$(xp,3)):w2=val(p$(xp,2)):rem read q & w offset values
- 220 mx=val(p$(xp,4)):c2=xc:rem value of max # cards in pile
- 230 ifxc>mxthenifmx<>0thenc2=mx
- 233 c2=c2-1
- 240 q=q1+(q2*c2):w=w1+(w2*c2):return
- 298 :
- 299 rem *** sound routine ***
- 300 pokef+24,6:pokef+5,128:pokef+4,129:fori=1to50:next:pokef+4,128:pokef+5,0
- 310 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128:return
- 798 :
- 799 rem *** drop on same suit ***
- 800 flag=1:lc$=c$(sp,cd,0):ss$=right$(lc$,1)
- 810 lf=val(c$(dp,0,0)):lf$=c$(dp,lf,0):ds$=right$(lf$,1)
- 820 ifss$=ds$thenflag=1:return
- 830 flag=-1:return
- 998 :
- 999 rem *** drop on correct increment ***
- 1000 flag=1:cj=val(p$(dp,7)):cj$=p$(dp,8):ifcj$="0"thenflag=-1:return
- 1010 ifcj$="-"thencj=-1*cj
- 1020 rp$=mid$(c$(sp,cd,0),2,1):gosub5100:rs=rp
- 1030 rp$=mid$(c$(dp,lf,0),2,1):gosub5100:rd=rp
- 1040 ifrd=rs+cjthengoto1070
- 1050 ifrd=13thenifrs=1thengoto1056
- 1052 ifrd=1thenifrs=13thengoto1060
- 1054 goto1072
- 1056 if(dp=1ordp=2ordp=3ordp=4)thengoto1070
- 1058 goto1072
- 1060 if(dp=1ordp=2ordp=3ordp=4)thengoto1072
- 1062 goto1070
- 1070 flag=1:return
- 1072 flag=-1:return
- 1098 :
- 1099 rem *** drop on opposite color ***
- 1100 flag=1:ifleft$(c$(sp,cd,0),1)<>left$(c$(dp,lf,0),1)thenflag=1:return
- 1110 flag=-1:return
- 4998 :
- 4999 rem *** print string ***
- 5000 poke781,q:poke782,w:sys65520:printq$:return
- 5098 :
- 5099 rem *** get rank and value ***
- 5100 ifrp$="1"thenrp$="10":rp=val(rp$):return
- 5110 ifrp$="j"thenrp$="11":rp=val(rp$):return
- 5120 ifrp$="q"thenrp$="12":rp=val(rp$):return
- 5130 ifrp$="k"thenrp$="13":rp=val(rp$):return
- 5140 ifrp$="a"thenrp$="1":rp=val(rp$):return
- 5141 rp=val(rp$):return
- 5148 :
- 5149 rem *** keyboard movement ***
- 5150 ifval(c$(10,0,0))=0andval(c$(11,0,0))=0then5170
- 5155 poke1820,30:poke56092,0:gosub5300:ifqf=1thenreturn
- 5157 ifa<>32anda<>13then5150
- 5158 poke1820,32:ifa=13thenpi=11:return
- 5160 poke1540,30:poke55812,0:gosub5300:ifqf=1thenreturn
- 5162 ifa<>32anda<>13then5160
- 5165 poke1540,32:ifa=13thenpi=10:return
- 5170 ifval(c$(5,0,0))=0then5180
- 5172 poke1426,30:poke55698,0:gosub5300:ifqf=1thenreturn
- 5174 ifa<>32anda<>13then5170
- 5175 poke1426,32:ifa=13then pi=5:return
- 5180 poke1833,30:poke56105,0:gosub5300:ifqf=1thenreturn
- 5182 ifa<>32anda<>13then5180
- 5185 poke1833,32:ifa=13then pi=6:return
- 5190 poke1840,30:poke56112,0:gosub5300:ifqf=1thenreturn
- 5192 ifa<>32anda<>13then5190
- 5195 poke1840,32:ifa=13then pi=7:return
- 5200 poke1847,30:poke56119,0:gosub5300:ifqf=1thenreturn
- 5202 ifa<>32anda<>13then5200
- 5205 poke1847,32:ifa=13then pi=8:return
- 5210 poke1854,30:poke56126,0:gosub5300:ifqf=1thenreturn
- 5212 ifa<>32anda<>13then5210:
- 5215 poke1854,32:ifa=13then pi=9:return
- 5220 poke1116,31:poke55388,0:gosub5300:ifqf=1thenreturn
- 5222 ifa<>32anda<>13then5220
- 5225 poke1116,32:ifa=13then pi=1:return
- 5230 poke1123,31:poke55395,0:gosub5300:ifqf=1thenreturn
- 5232 ifa<>32anda<>13then5230
- 5235 poke1123,32:ifa=13then pi=2:return
- 5240 poke1130,31:poke55402,0:gosub5300:ifqf=1thenreturn
- 5242 ifa<>32anda<>13then5240
- 5245 poke1130,32:ifa=13then pi=3:return
- 5250 poke1137,31:poke55409,0:gosub5300:ifqf=1thenreturn
- 5252 ifa<>32anda<>13then5250
- 5255 poke1137,32:ifa=13then pi=4:return
- 5260 goto5150
- 5298 :
- 5299 rem *** get key press ***
- 5300 ifqf=1thenreturn
- 5310 poke198,0:wait198,1:geta$:a=asc(a$)
- 5320 ifa=42andch=-1then5310
- 5340 ifa=42thengosub9400:goto5300
- 5350 return
- 5398 :
- 5399 rem *** drop card on foundations ***
- 5400 lf=val(c$(dp,0,0)):iflf>0then5410
- 5405 ifp$(dp,5)=mid$(c$(sp,cd,0),2,1)then5430
- 5410 gosub800:ifflag=-1thengosub150:return
- 5420 gosub1000:ifflag=-1thengosub150:return
- 5430 q=val(p$(dp,1)):w=val(p$(dp,0)):q$=ca$:gosub5000
- 5440 q=q+1:w=w+1:q$=c$(sp,cd,0):gosub5000:gosub300
- 5450 gosub100:xp=sp:xc=cd:gosub200
- 5460 ifcd=0thenreturn
- 5470 q$=ca$:gosub5000:q=q+1:w=w+1:q$=c$(sp,cd,0):gosub5000:gosub300:return
- 5498 :
- 5499 rem *** pick up card ***
- 5500 cd=val(c$(sp,0,0)):xc=cd:xp=sp:gosub200
- 5510 q$=er$:gosub5000:ifcd=1thenreturn
- 5520 if(sp=5orsp=10)then5535
- 5525 xc=cd-1:xp=sp:gosub200:q$=ca$:gosub5000:q$=c$(sp,cd-1,0)
- 5530 q=q+1:w=w+1:gosub5000:gosub300:return
- 5535 q$=ca$:gosub5000:q$=bl$:xc=cd:xp=sp:gosub200:gosub5000:return
- 5598 :
- 5599 rem *** drop card on building pile ***
- 5600 lf=val(c$(dp,0,0)):iflf=0then5660
- 5620 gosub1100:ifflag=-1thengosub150:return
- 5630 gosub1000:ifflag=-1thengosub150:return
- 5640 xp=dp:xc=lf+1:gosub200:q$=ca$:gosub5000:q=q+1:w=w+1:q$=c$(sp,cd,0)
- 5650 gosub5000:gosub300:goto5680
- 5660 q=val(p$(dp,1)):w=val(p$(dp,0)):q$=ca$:gosub5000:q=val(p$(dp,1))
- 5670 w=val(p$(dp,0)):q$=c$(sp,cd,0):q=q+1:w=w+1:gosub5000:gosub300
- 5680 gosub100
- 5690 ifcd=0thenreturn
- 5700 ifsp=5orsp=10thenxp=sp:gosub150:return
- 5710 xp=sp:xc=cd:gosub200:q$=c$(sp,cd,0):q=q+1:w=w+1:gosub5000:gosub300:return
- 5798 :
- 5799 rem *** pick up card from hand & drop on waste pile ***
- 5800 cd=val(c$(sp,0,0)):dp=10:lf=val(c$(dp,0,0))
- 5802 ifcd=0andlf=0thenreturn
- 5804 ifcd=0andd2=1thengosub6000:return
- 5805 ifcd=0thend2=d2+1:gosub5900
- 5810 q=val(p$(dp,1)):w=val(p$(dp,0)):q$=ca$:gosub5000
- 5820 q=q+1:w=w+1:q$=c$(sp,cd,0):gosub5000:gosub300
- 5830 gosub100:ifcd=0thenq=val(p$(sp,1)):w=val(p$(sp,0)):q$=er$:gosub5000
- 5840 return
- 5898 :
- 5899 rem *** redeal ***
- 5900 c$(11,0,0)=str$(lf):c$(10,0,0)=str$(cd):forx=1to40:c$(11,x,0)="":next
- 5920 forx=lfto1step-1:c$(11,x,0)=c$(10,lf-x+1,0):next:cd=lf:lf=0
- 5930 q=val(p$(10,1)):w=val(p$(10,0)):q$=bl$:gosub5000
- 5940 q=val(p$(11,1)):w=val(p$(11,0)):q$=ca$:gosub5000:q$=ba$:gosub5000:gosub300
- 5950 return
- 5998 :
- 5999 rem *** no more redeals ***
- 6000 q=22:w=0:q$=sp$+sp$:gosub5000
- 6010 q=22:w=0:q$="no more re-deals allowed. you must use the cards you have."
- 6020 q$=q$+" -- * to quit":gosub5000:return
- 8888 :
- 8889 rem *** initial set up ***
- 9000 printchr$(147):flag=1:ch=1:w=val(p$(1,0)):q=val(p$(1,1)):q$=ca$:gosub5000
- 9005 q=q+1:w=w+1:q$=c$(1,1,0):gosub5000:gosub300
- 9010 w=val(p$(5,0)):q=val(p$(5,1)):q$=ca$:gosub5000
- 9015 q=q+1:w=w+1:q$=c$(5,7,0):gosub5000:gosub300
- 9020 forx=6to9:w=val(p$(x,0)):q=val(p$(x,1)):q$=ca$:gosub5000
- 9022 q=q+1:w=w+1:q$=c$(x,1,0):gosub5000:gosub300:next
- 9030 w=val(p$(11,0)):q=val(p$(11,1)):q$=ca$:gosub5000:q$=ba$:gosub5000:gosub300
- 9040 q=22:w=0
- 9045 q$="[144]move arrow with space bar - use return to pick up or drop card"
- 9050 q$=q$+" - * to quit":gosub5000
- 9052 d$=p$(1,5):ifd$="1"thend$="10"
- 9055 q=1:w=0:q$="[156]base[157][157][157][157]card[157][157][157][157]is "+d$:gosub5000
- 9060 ifqf=1thengoto30
- 9063 ifval(c$(1,0,0))<>13then9068
- 9064 ifval(c$(2,0,0))<>13then9068
- 9065 ifval(c$(3,0,0))<>13then9068
- 9066 ifval(c$(4,0,0))<>13then9068
- 9067 goto9300
- 9068 ifch=1thenq=12:w=0:q$="pick up[157][157][157][157][157][157][157]card":gosub5000:gosub5150:sp=pi
- 9069 ifpi=99thengoto9060
- 9072 ifch=-1thenq=12:w=0:q$="[129]drop [157][157][157][157][157][157][157]card":gosub5000:gosub5180:dp=pi
- 9073 ifpi=99thengoto9060
- 9075 if(pi=1orpi=2orpi=3orpi=4)andch=1then9060
- 9080 if(pi=1orpi=2orpi=3orpi=4)andch=-1thengosub5400:ch=1:goto9060
- 9085 ifpi=5andch=1andval(c$(sp,0,0))=0then9060
- 9090 ifpi=5andch=1thengosub5500:ch=-1:goto9060
- 9100 ifpi=5andch=-1thengosub150:ch=1:goto9060
- 9105 if(pi=6orpi=7orpi=8orpi=9)andch=1andval(c$(sp,0,0))=0then9060
- 9110 if(pi=6orpi=7orpi=8orpi=9)andch=1thengosub5500:ch=-1:goto9060
- 9120 if(pi=6orpi=7orpi=8orpi=9)andch=-1thengosub5600:ch=1:goto9060
- 9125 ifpi=10andch=1andval(c$(sp,0,0))=0then9060
- 9130 ifpi=10andch=1thengosub5500:ch=-1:goto9060
- 9140 ifpi=10andch=-1thengosub150:ch=1:goto9060
- 9150 ifpi=11andch=1thengosub5800:ch=1:goto9060
- 9160 ifpi=11andch=-1thengosub150:ch=1:goto9060
- 9170 goto9060
- 9298 :
- 9299 rem *** win game ***
- 9300 printchr$(147):forx=1to30:print"[144]congratulations!! you won!!!";:next
- 9310 q=10:w=5:q$="congratulations!! you won!!!":gosub5000
- 9320 q=23:w=6:q$="press space bar to continue.":gosub5000:gosub5300
- 9330 printchr$(147):print"[144]do you want to play again (y/n)?[160]":gosub5300
- 9340 ifa$="n"then 9500
- 9350 ifa$="y"thenflag=2:goto 9490
- 9360 goto9330
- 9398 :
- 9399 rem *** end game ***
- 9400 q=22:w=0:q$=sp$+sp$:gosub5000:q=22:w=0
- 9410 q$="[144]do you want to end this game (y/n)?[160]":gosub5000:gosub5300
- 9420 ifa$="y"then 9450
- 9430 ifa$="n"then9530
- 9440 goto9410
- 9450 sc=val(c$(1,0,0))+val(c$(2,0,0))+val(c$(3,0,0))+val(c$(4,0,0))
- 9460 printchr$(147):print"there were "sc" cards in the base piles."
- 9480 q=11:w=0:q$="do you want to play again (y/n)?[160]":gosub5000:gosub5300
- 9490 ifa$="y"andflag=2thenrun
- 9495 ifa$="y"thenqf=1:pi=99:return
- 9500 ifa$="n"thenq=14:w=0:q$="come back and play again.":gosub5000:goto9520
- 9510 goto9480
- 9520 print"[147]load"chr$(34)"hello"chr$(34)",8":print"run"
- 9525 poke198,0:poke631,13:poke632,13:poke198,2:end
- 9530 q=22:w=0
- 9540 q$="[144]move arrow with space bar - use return to pick up or drop card"
- 9550 q$=q$+" - * to quit":gosub5000:return
- 19998 :
- 19999 rem *** set up deck ***
- 20000 forx=1to13:x$=str$(x):d$(x)=right$(x$,len(x$)-1):next
- 20060 forx=14to26:x$=str$(x-13):d$(x)=right$(x$,len(x$)-1):next
- 20070 forx=27to39:x$=str$(x-26):d$(x)=right$(x$,len(x$)-1):next
- 20080 forx=40to52:x$=str$(x-39):d$(x)=right$(x$,len(x$)-1):next
- 20090 d$(11)="j":d$(24)="j":d$(37)="j":d$(50)="j"
- 20100 d$(12)="q":d$(25)="q":d$(38)="q":d$(51)="q"
- 20110 d$(13)="k":d$(26)="k":d$(39)="k":d$(52)="k"
- 20120 d$(1)="a":d$(14)="a":d$(27)="a":d$(40)="a"
- 20130 forx=1to13:d$(x)=""+d$(x)+"[211]":next
- 20140 forx=14to26:d$(x)=""+d$(x)+"[218]":next
- 20150 forx=27to39:d$(x)="[144]"+d$(x)+"[193]":next
- 20160 forx=40to52:d$(x)="[144]"+d$(x)+"[216]":next
- 20168 :
- 20169 rem *** initialize strings ***
- 20170 sp$=" "
- 20180 return
- 20198 :
- 20199 rem *** shuffle deck ***
- 20200 printchr$(147):q=22:w=13:q$="[144]shuffling deck":gosub5000:rd=0
- 20210 forc9=1to52:c%=(rnd(q9)*52)+1
- 20220 t$=d$(c9):d$(c9)=d$(c%):d$(c%)=t$
- 20230 q=8:w=17:q$=ca$:gosub5000:q=q+1:w=w+1:q$=d$(c9):gosub5000:gosub300:next
- 20240 q=8:w=17:q$=ba$:gosub5000:gosub300
- 20318 :
- 20319 rem *** set up card array ***
- 20320 forx=1to11:c$(x,0,0)="":next:d2=0:qf=0
- 20325 c9=1:c$(1,1,0)=d$(c9):c9=c9+1:c$(1,0,0)="1"
- 20330 fory=1to7:c$(5,y,0)=d$(c9):c9=c9+1:next:c$(5,0,0)="7"
- 20340 fory=1to4:c$(y+5,1,0)=d$(c9):c9=c9+1:next:fory=1to4:c$(y+5,0,0)="1":next
- 20350 fory=1to40:c$(11,y,0)=d$(c9):c9=c9+1:next:c$(11,0,0)="40":c$(11,0,1)="-1"
- 20355 forx=1to4:p$(x,5)=mid$(c$(1,1,0),2,1):next
- 20360 return
- 40000 poke53280,14:poke53281,1:poke53272,21:printchr$(144)
- 40002 dimd$(52),p$(11,9),c$(11,40,1)
- 40005 printchr$(147)
- 40010 ca$="[144][176][195][195][195][174][157][157][157][157][157][194] [194][157][157][157][157][157][194] [194][157][157][157][157][157][194] [194][157][157][157][157][157][173][195][195][195][189]"
- 40020 ba$="[166][166][166][157][157][157][157][157][166][166][166][157][157][157][157][157][166][166][166][157][157][157][157][157]"
- 40030 bl$=" [157][157][157][157][157] [157][157][157][157][157] [157][157][157][157][157][146]"
- 40040 er$=" [157][157][157][157][157] [157][157][157][157][157] [157][157][157][157][157] [157][157][157][157][157] [146]"
- 40050 b1$="[166][166][157][157][157][157][166][166][157][157][157][157][166][166][157][157][157][157]"
- 40060 forx=1to8:q=6:w=(3*x)+5:q$=ca$:gosub5000
- 40070 q$=ba$:gosub5000
- 40100 gosub300:next
- 40110 c$="[159][153][156][150][158][155]":s$="spectrum":forx=1to8:sp$=mid$(s$,x,1):cp$=mid$(c$,x,1)
- 40115 sp$=cp$+sp$
- 40120 forx1=1to5+(x*3):q=23:w=x1:q$="[156] "+sp$:gosub5000:next
- 40130 forx2=23to12step-1:q=x2:w=x1:q$=" ":gosub5000:q$="[156][145]"+sp$:gosub5000
- 40140 next
- 40145 q=q-6:w=w-1:q$=cp$+b1$:gosub5000
- 40147 pokef+24,0:pokef+24,15
- 40150 next
- 40155 w=w+1:q$=cp$+b1$:gosub5000
- 40160 print" a solitaire game for the c-64"
- 40162 print" by"
- 40164 print" donna k. woody"
- 40168 :
- 40169 rem *** set up pile array ***
- 40170 forc1=1to11:forc2=0to9:readp$(c1,c2):next:next
- 40172 data7,0,0,0,0,0,0,1,-,0,14,0,0,0,0,0,0,1,-,0,21,0,0,0,0,0,0,1,-,0
- 40174 data28,0,0,0,0,0,0,1,-,0,0,5,0,0,0,0,1,0,0,0,7,5,0,2,6,0,1,1,+,0
- 40176 data14,5,0,2,6,0,1,1,+,0,21,5,0,2,6,0,1,1,+,0,28,5,0,2,6,0,1,1,+,0
- 40178 data34,7,0,0,0,0,1,0,0,11,34,14,0,0,0,0,1,0,0,10
- 40180 q=23:w=0:q$=" do you need instructions (y/n)?[160]":gosub5000:gosub5300
- 40190 ifa$="n"then40196
- 40192 ifa$<>"y"then40180
- 40194 goto40220
- 40196 q=23:w=0:q$="[144] .....please wait..... ":gosub5000:return
- 40218 :
- 40219 rem *** instructions ***
- 40220 printchr$(147):print" s[159]p[156]ect[158]r[150]u[155]m[129] is a card game played with a":print
- 40230 print"standard deck of 52 cards.":print
- 40240 print" the computer will shuffle the cards":print
- 40250 print"and deal them into 6 piles. the first":print
- 40260 print"card in the top row is the base card.":print
- 40270 print"this card is to be built up in suit":print
- 40280 print"until the pile contains 13 cards.":print
- 40290 print" the four cards dealt in the row":print
- 40300 print"below the base card are the building":print
- 40310 print"piles. these can be built in":print
- 40312 q=23:w=6:q$="press space bar to continue.":gosub5000:gosub5300:printchr$(147)
- 40320 print"descending sequence and alternating":print
- 40330 print"colors. kings can be built on aces.":print
- 40340 print" 7 cards are dealt in a single pile":print
- 40350 print"to the left of the building piles to":print
- 40360 print"form the stock. cards from the stock":print
- 40370 print"may be built on base cards, building":print
- 40380 print"piles or used to fill empty spaces in":print
- 40390 print"the building piles row.":print
- 40400 print" the remaining cards are placed in":print
- 40410 print"the hand and may be played to the waste":print
- 40412 q=23:w=6:q$="press space bar to continue.":gosub5000:gosub5300:printchr$(147)
- 40420 print"pile one card at a time.":print
- 40430 print" cards from the waste pile may be":print
- 40440 print"built on the building piles or the base":print
- 40450 print"piles.":print
- 40460 print" only one card may be moved from a":print
- 40470 print"pile at a time.":print
- 40480 print" cards may not be placed on the stock":print
- 40490 print"from any pile. the waste pile will":print
- 40500 print"only accept cards from the hand.":print
- 40510 print" you may go through the cards in the":print
- 40512 q=23:w=6:q$="press space bar to continue.":gosub5000:gosub5300:printchr$(147)
- 40520 print"hand twice.":print
- 40530 print" the object of the game is to build":print
- 40540 print"the base cards up in suit until each":print
- 40550 print"pile contains 13 cards.":print
- 40560 print" you may end the game at any time by":print
- 40570 print"pressing the '*' key. the arrow points":print
- 40580 print"to the card you want to move. use the":print
- 40590 print"space bar to move the arrow and the":print
- 40600 print"return key to pick up or drop a card."
- 40612 q=22:w=6:q$="press space bar to continue.":gosub5000:gosub5300
- 40620 q=22:w=5:q$=".......one moment please....... ":gosub5000
- 40630 return
-