CANINSCANFELDCANINS!BOOT 3 ##0*BASIC
PAGE=&1900
*FX21
CLOSE#0:CHAIN "CANINS"
CANFIELD PATIENCE
by Michael Leete
(C) 1990 The Micro User
(
2*FX200,3
<TvA
F7:23;8202;0;0;0;
P&cntr(1,1,1," Canfield Patience")
Z%cntr(0,2,2," by Michael Leete")
dcntr(0,4,4," (c) 1990 The Micro User.")
n'" Canfield Patience was probably invented or at least named and written down  in the Naughty Nineties at Saratoga, where a certain Mr. Canfield kept a casino. He introduced this particular"
x]"form of patience as a gambling game, setthe stakes and formalised the house rules."
" The punter paid $50 to play and received five dollars for every card placed on the Foundation piles. If he completed the game, he was paid a bonus,making a total payment of 500 dollars.":*FX15,0
P8,23);130;(157);129;" PRESS A KEY ";156;:28,0,22,39,8:*FX200,2
A=::*FX15,0
" The attraction of the big win was enormous  a cavalry trooper's pay was $13 a month  but the odds were heavily in the House's favour."
" The usual statistical estimate is that a full pack comes out once in 30 games and, for the rest, an average of about six Foundation cards is all that can be expected."
O" Testing our computer version of the game gave rather better results."
A=::*FX15,0
" Sixty three games came out in a total of 1,469 played and the average number of cards removed in the remaining games fluctuated around 7.5. The accumulated fund then stood at a win of $11,310."
" The method of play is simple: Thirteen cards are counted off the top of the pack and placed, face up, on the left of the table to form the Stock. The nextcard is the first Foundation and the"
܊"object is to build four Foundation pilesin suits, in ascending, circular order starting from the same value as the first card."
A=::*FX15,0
"Four more are dealt, again face up, as the beginning of the Tableau. Cards from the remainder are dealt in threes and the top card of the resulting Waste may be placed on the Foundation or,"
V"alternately red and black, in the Tableau in descending, circular values."
" Part runs of cards may be moved from column to column and, as a column becomes vacant, it must first be filled from the Stock and then, at will, from the Waste."
A=::*FX15,0
" Cards cannot be transferred directly from the Stock to the Foundation  in other words, they must first go into a space. In essence, therefore, the chief difficulty lies in bringing all the Stock cards into play."
"" Mr. Canfield's problem was to provide sharpeyed croupiers to keep an eye out for cheats  the micro takes care of that for you and will set up a new game more quickly and more efficiently than Nick the Greek."
,A=
6*FX200,3
@26,12:
J=&1100:"CANFELD"
T
^cntr(D%,C%,Y%,msg$)
hX%=(40(msg$))/2
rmsg$=(128+C%)+msg$
+D%=1 N%=01:X%2,Y%+N%)141msg$::
X%1,Y%+N%)msg$
K CANFIELD PATIENCE DO NOT RENUMBER THIS PROGRAM!
by Michael Leete
(c) The Micro User
(:
2
0
Z A$="D" D: D@A 16,30)A$:f%=(A$):20,30)"To:"29,30);R;32,30)"Removed":*FX21
B$=: "1234F",B$)<>0
24,30)B$:t%=(B$)
B$=A$ p%=0
B$="F" t:D@A
" A$="S" pile:D@A
,! A$="W" A%=f: A%=m(f%,t%)
6 A% e
@16,30)124,30)1
J? R=52:1:9,30)"Congratulations  You win $500":F%=F%+240
T6 X=1 10:1,5X,110+X,1:1,5X,130+X,1::*FX21
^ A=
h A=78 A=89
rA=89 : !4
:
pile
P=0 e:
(b$(t%))<>0 e:
)c$=pile$,2):pile$=pile$,(pile$)2)
b$(t%)=c$:c%(t%)=1
Q:f(t%)
:
ݤm(s%,d%)
l$=b$(d%),2):l$=""l$="0"
n$=v$,v$,l$,1))1,1)
"g$=b$(s%): J%=1 (b$(s%))2
x$=b$(s%),J%,1)
x$=n$ p%=J%
Jp%<1=0c$=b$(s%),p%,2):c$,n$)=0=0笤T =0q$=g$,p%,(g$)p%+1)
&, X%=1 (q$)2:b$(d%)=b$(d%)+q$,X%,2)
0b$(s%)=b$(s%),(b$(s%))2)
:f(d%):f(s%)
D
Nc%(s%)=c%(s%)1
X=
b:
lݤf
v) (k$)<1 =0c$=k$,2):l$=b$(t%),2)
+l$="" P>0 =0 l$=""l$="0":tTB
0 "SC",e$)<>0 =0 "DH",d$)<>0 "DH",e$)<>0 =0 =
:
f(C%)
y%=(b$(C%))+20
w y%=20 31,6*C%+5,y%/2+2:(3):31,6*C%+5,y%/2+3:3:31,6*C%+5,y%/2+4:3:31,6*C%+5,y%/2+5:3:: c$=b$(C%),2)
"HD",c$,1)) 1 0
*131
4z "H",c$,1)) c$=c$,1)+(224) "D",c$,1)) c$=c$,1)+(226) "S",c$,1)) c$=c$,1)+(225) c$=c$,1)+(227)
>c$=c$,1)+" "+c$,1)
H31,6*C%+5,y%/2+1: c$
R31,6*C%+5,y%/2+2: (3)
\31,6*C%+5,y%/2+3: (3)
f$t$=c$,1):c$=c$+" "+t$:c$=c$,3)
p31,6*C%+5,y%/2+4: c$
ztck
130
31,6*C%+5,y%/2+5:(3)
:
D
6((f$)=4 (f$)=2) c$=f$,2):k$=f$+k$:f$="":S:
$ I%=1 3: (f$)=0 f$=k$:k$=""
k$=f$,2)+k$:f$=f$,(f$)2)
c$=k$,2)
S
:
s
f$="":D%=52
I%=1 52
$A%=((1)*D%+1)
.f$=f$+p$,2*A%1,2)
8+L$=p$,(A%1)*2):R$=p$,((p$)/2A%)*2)
Bp$=L$+R$
LD%=D%1
V
:p$=f$:
`:
jl
t+3:19,1)"F=FOUNDATIONS"1,6)"S=STOCK"
~+5:380,700:0,3:"1 2 3 4"
4,31,1,21:"W=WASTE"30:S
I%=13 1 1
pile$=f$,2)+pile$
f$=f$,(f$)2)
c$=pile$,2)
Q
c$=f$,2)
f$=f$,(f$)2)
x$=c$,1)
33,1)"("+x$+")"
S%="HSDC",c$,1))
s$(S%)=c$
R(S%)
J%=w$,c$,1))
x$=v$,J%,13):v$="#"+x$+"0"
( I%=1 4
2b$(I%)=f$,2)
<f$=f$,(f$)2)
F
f(I%)
Pc%(I%)=1
Z
d
n:
xQ
P=P1: P=0 c$="#"
p(pile$,2),44,560)
:
S
p(k$,2),44,32)
:
i
I%=1 4
b$(I%)=24," ")
s$(I%)="#"
c%(I%)=1
:
"p(c$,x%,y%)
, c$="#" c$=""
629,x%;y%;24,4;0;192;227;
@0,131::5
Jr c$="" 0,1:16,128:"EMPTY":4:: V$=c$,1):v%=w$,V$):S$=(223+"HSDC",c$,1))):"HD",c$,1)) 0,1 0,0
T0,223: V$
^160,32: V$
h v%>10 P: n
r4:tck

:
n
v%+2500
x%,y%
x%<>0 x%*416,y%*4+16:S$
x%=0
:
P
_ V$="J" V$="JACK":32,124: V$: V$="Q" V$="QUEEN":16,124: V$: V$="KING":32,124: V$
0,190:S$:158,68:S$:
:
R(S%)
R=R+1
29,30);R
p(c$,S%*224+148,720)
&
0:
:t
D& A$="W" c$=k$,2) c$=b$(f%),2)
Nc$=""e:
X.S%="HSDC",c$,1)):n$=v$,v$,c$,1))1,1)
b s$(S%),1)<>n$ e:: s$(S%)=c$:R(S%): A$="W" k$=k$,(k$)2):S:: c$=b$(f%):b$(f%)=c$,(c$)2): (c$)/21n+100
130:10,28)(10)
:
tck
0,5,5,1
C=1 200:
*
4:
: Data for Cards
24,27,0
24,48,24,8,0
24,48,24,27,24,8,0
13,48,35,48,13,8,35,8,0
"13,48,35,48,13,8,35,8,24,27,0
(13,48,35,48,13,8,35,8,13,27,35,27,0
.13,48,35,48,13,8,35,8,13,27,35,27,24,38,0
413,48,35,48,13,8,35,8,13,27,35,27,24,38,24,18,0
:13,48,35,48,13,8,35,8,24,27,13,35,35,35,13,21,35,21,0
B13,48,35,48,13,8,35,8,13,35,35,35,13,21,35,21,24,38,24,18,0,0