GINRINSGIN-R GINRINS!BOOT 3 9#0*BASIC
PAGE=&1900
*FX21
CLOSE#0:CHAIN "GINRINS"
" GIN RUMMY: Traditional Games
# Presented by Gemini Games Ltd
# Copyright D.K.Barker-Hahlo 82
(
2*FX200,3
<d`A
F7:23;8202;0;0;0;
PS" Gin Rummy by D.K.Barker-Hahlo Gin Rummy by D.K.Barker-Hahlo "
Z:*FX200,2
d"This is a card game for two players, one of the great Rummy family. It is not a difficult game to play, so far asthe rules are concerned, but to play well takes considerable skill and concentration."
n"The object, as in all Rummy games, is to build your hand, collecting and discarding as play proceeds, until you are in a position to lay down your hand."
x"The rules of Gin differ in certain respects from other members of the family, so if you are not totally familiar with them, you should study the following carefully."
''
1'" Press SPACE BAR to continue...":*FX15,0
=32:28,0,22,39,2::*FX15
'"RULES:"
"The pack is shuffled, and TEN cards are dealt to either hand. The remaining32 cards form the STOCK, which is kept face down on the table. The top card ofthe stock is turned up, placed along-"
*"side, and starts the DISCARD pile."
"AT FIRST TURN. A special sequence of events occurs on the first turn. The dealer deals; if the other player takesup the discard, play proceeds normally.If not, the dealer may pick up the"
ȴ"discard if he wishes. If he does, non- dealer must draw the top card of the stock and make his discard (or go out).Dealer now cannot pick up this discard on his turn."
V"Play then proceeds by each player in turn, until one or the other goes out."
=32::*FX15
'"The object is to collect matching sets of cards. A SET consists of three or more cards of the same value, OR of thesame suit and in sequence. A card cannot form part of more than one set."
"You cannot 'go round the corner', so CK, CA, C2 is not a set. In the case ofS6, C6, D6, D7, D8, either the diamondsor the sixes form a set, with two unmatched cards."
"A hand is VALUED by the total of the unmatching cards it contains. As Ace counts one, 2 to 10 the face value, Jack, Queen and King count 10 each."
"In most forms of Rummy, a set may be placed face up on the table at any time, producing certain benefits, and disadvantages. In Gin, this does not happen."
=32::*FX15
'"KNOCKING. The process of going out is called 'knocking'. A player may knock when, having made his discard, his value would be 10 or less. He must declare his intention of doing so"
"w"before discarding; this is done by knocking on the table, laying down the hand, then playing the discard."
,"In laying down the hand, the sets are kept separate from the unmatched cards.The knocker now declares the value of his hand; then the other player may 'lay-off' cards from his hand onto sets";
6"on the table. In this way, he may reduce the value of his unmatched cardsand may re-arrange his hand to take thebest advantage of this. He may not,"
@="though, re-arrange knocker's hand to suit himself."
J=32::*FX15
T'"SCORING:"
^"1. Cards. The value of the two hands are subtracted one from the other; whichever had less, scores this figure.";
hJ"GIN. If the knocker had a 'Gin' hand, he receives a bonus of 25."
r"UNDERCUT. If the other hand has the same value, or less, he scores a bonus of 25. This does not apply in the case of a Gin hand."
|G"2. BOX. The eventual winner of each hand receives 25 bonus."
"3. GAME. Game is reached when either player's card score, including bonuses for Gin and Undercut reaches 100. That player receives a bonus of 100."
"4. WHITEWASH. If a player makes game without the other player having scored at all, you get a further bonus of 100.";
=32::*FX15
'"OPERATING THE GAME:"
"The top left corner shows whose turn it is. The stock and discard pile are shown in the middle, with the quantity remaining in the stock to its left."
"At the end of the hand, the computer declares its score, and you are asked to enter your net score and then the computer's. Unfortunately there isn't room in memory for it to work out the"
"best possible combination of sets and lay-offs. Don't include bonuses for Gin, Undercut etc.; these the computer does know about."
"Between hands, the middle of the screenwill show the current score. The computer continues to deal, with the deal in fact alternating, until Game isreached. Press any key to play again."
=32
*FX200,3
26,12,28,0,0,0,0
*RUN "GIN-R"
d2 GIN RUMMY Copyright D.K.Barker-Hahlo 20.8.82
n"1:@%=1:19,130,4,0,0,0,17,130
xK,Q,J,T,9,8,7,6,5,4,3,2,A
&23,252,16,56,124,254,214,16,16,16
&23,253,66,231,255,255,126,60,24,0
%23,254,16,56,124,254,124,56,16,0
&23,255,56,56,16,214,254,214,16,16
+23,250,255,255,255,255,255,255,255,255
X=(-):PA=0:DS=0:DL=-1
HPA%(51),H%(1,10),DS%(32),TN$(1),M%(3,14),S%(52),SU$(3),SV$(13),C(5)
HTN$(0)="Yours":TN$(1)="Mine ":I=0 3:SU$(I)=(I+252)::YN$="N./RET"
I=1 13:SV$(I)::OFF
H DL=-DL:@%=1:board:12,26)"I'm shuffling.":I%=0 51:PA%(I%)=I%:
&I%=0 3:J%=0 14:M%(I%,J%)=0::
?A=52:I%=0 51:S=(A)-1:B=PA%(I%):PA%(I%)=PA%(S):PA%(S)=B:
PA=51:I=0 1:J=0 9
H%(I,J)=PA%(PA):PA=PA-1::
I=0 1:suitsort(I,9):
eval(9)
%I=0:J=0 9:pcard(3,J,H%(I,J)):
0
'C(I+2)=C(I+2)+C(I):C(I+4)=C(I+4)+25
showscores:key
C(I+2)>=100
)C(I+2)=C(I+2)+100:I*10+12,11)"100"'
7C(( I)+4)=0 C(I+2)=C(I+2)+100:I*10+12,15)"100"
I=2 3:C(I)=C(I)+C(I+2):
0,13)"Box "C(4)C(5)
0,18)"TOTAL"C(2)C(3)
(A=C(2)-C(3):M("NET SCORE "+((A)))
*FX15
:A=:
Myourdeal:0,3)TN$(TN):M("You dealt. I might want the discard. "):key
M(""):shalli:E=F:E
*(E1=0:M("Do you want the discard? ")
4'confirm(YN$)TN=0:pick:TN=1:E1=1
>M(""):
HBmydeal:0,3)TN$(TN):M("I dealt. Do you want the discard?")
R!confirm(YN$) pick:F1=1:
\"TN=1:shalli:E=F:TN=0:E key
f
pݤMAP(X,Y):M%=0
zM%(X,Y)>6 =9
M%(X,Y)=4 M%(X,Y)=5 =2
M%(X,Y)=6 M%=4
'A=3:B=1:J=0 3:M%(J,Y)=2 M%=M%-B
M%(J,Y)=1 THEM%=M%+A
M%(J,Y)=0 M%=M%+2-PA 10
(:M%(X,Y-1)=2 M%(X,Y+1)=2 M%=M%-B
&M%(X,Y-1)=1 M%(X,Y+1)=1 M%=M%+A
:(M%(X,Y-1)=0 Y>1)(M%(X,Y+1)=0 Y<13)M%=M%+2-PA 10
-(M%(X,Y-1)=0 Y>1) M%(X,Y+1)=0 M%=M%+1
Y>9 M%=M%+2
M%>8 M%=8
=M%
Oshalli:XY(DS%(DS)):I=0 3:M%(I,Y)=4 M%(I,Y)=6 M%(I,Y)=7 I=3::TnD
D:A=Y-1 Y+1 2:M%(X,A)=5 M%(X,A)=6 M%(X,A)=8 A=Y+1::TnD
?:M%(X,Y-1)>2 M%(X,Y-1)<7 M%(X,Y+1)>2 M%(X,Y+1)<7 TnD
?I=0 3:M%(I,Y)=3 (M%(I,Y-1)=3 M%(I,Y+1)=3) I=3::TnD
$:F=0:
.8strings(DS%(DS)):3:130:M("I shall take the "+A$)
8pick:F=1:
B0handscore:TT=0:T=0:K=I:XY(H%(TN,I)):DjD
L,T1=T2:J=I L:XY(H%(TN,J)):DjD:T=T+T2
VT2>T1 T1=T2:K=J
`:
jT2=14-Y:T2>10 T2=10
t
~.eval(F):I=0 F:XY(H%(1,I)):M%(X,Y)=3:
;suitsort(1,F):I=0 F:XY(H%(1,I)):M%(X,Y+1)<>3 tzD
C=0:K=Y
K=K+1:C=C+1: M%(X,K)<>3
S=3:C=2 S=5 C>2 S=8
J=Y K-1:M%(X,J)=S:
I=1 13:C=0
(J=0 3:M%(J,I)>2 M%(J,I)<8 C=C+1
:C<2 T@E
AJ=0 3:(M%(J,I)=3 M%(J,I)=5)C=2 M%(J,I)=M%(J,I)+1: dvD
*M%(J,I)>2 M%(J,I)<8 M%(J,I)=7:TJE
:
(K=I-1 I+1 2:M%(J,K)=5 M%(J,K)=3
:
"dis:DS=DS+1:DS%(DS)=H%(TN,K)
()K<10 I=K 9:H%(TN,I)=H%(TN,I+1):
2XY(DS%(DS)):M%(X,Y)=2:
<"disdis:pcard(2,0,DS%(DS)):
F#XY(A):X=A 13:Y=(A 13)+1:
Pyoursort
Z+:M("No. of card to move?"):A$=: OK
dS1=K
n*:M("Destination"):A$=: OK K<>S1
xS=K:M("")
_B=H%(TN,S1):S1~~0
.M("Stock finished. Turning the discards")
FA=PA%(PA):PA=DS:S=PA:I=0 PA:PA%(I)=DS%(S):S=S-1::PA%(PA)=A:DS=0
key:PPROCpcard(2,0,52)
7,14)PA:M(""):
;pick:H%(TN,10)=DS%(DS):DS=DS-1:DS=0 A=52 A=DS%(DS)
/pcard(2,0,A):TN=0 pcard(3,10,H%(TN,10))
/XY(H%(TN,10)):TN=1 M%(X,Y)=3 M%(X,Y)=1
Eboard:12:"Turn ";:129:" Gin Rummy - (C) 1983 Gemini ":130
'256,766:928,766:256,930:928,930
"EX=256:Y=930:Y1=766:I=1 10:X,Y:X,Y1:X=X+64::X=X+32:X,Y:X,Y1
,I=1 10:7+I*2,5)"?":
6EX=352:Y=674:Y1=Y-164:X,Y:X,Y1:X+96,Y1:X+96,Y:X,Y:12,13)"?"
@#5,12)"Stock"27,12)"Discards"
J10:131:X=23:Y=11:I=1 5:X,Y)" ":Y=Y+1:
T6X=6:Y=19:I=1 5:X,Y)21," ")28,Y)" ":Y=Y+1:
^13:130:7,24);:I=0 9:I" ";::29,24)"^"
h8X=256:Y=412:Y1=Y-160:I=1 9:X,Y:6,X,Y1:X=X+64::
r+strings(A):A=52 131:B$=" ":C$=B$:
| 0:131:XY(A):X=1 X=2 1
"C$=SU$(X):B$=SV$(Y):A$=C$+B$:
&pcard(A,J,card%):strings(card%)
A=1 X=9+2*J:Y=3
(A=2 X=24:Y=11 A=3 X=7+J*2:Y=19
J=10 X=X+2
(X,Y)B$;:8,10,10:C$;:8,10,10:B$
3:130:
key:12,29)"PRESS A KEY";
G=:0,29)39," "):
ON:23;&670A;0;0;0;:
OFF:23;&200A;0;0;0;:
"9"A$<>"^")=
A$="^"A$="10"
K=(A$):=
& ݤconfirm(A$):A$<>"" A$;
0ON
: G= 223:G=78 G=13
DOFF:M(""):G=13 = =
N(M(M$):0,26)79," "):0,26)M$;:
X)suitsort(I,A):K=A 1 -1:J=0 A-K
b>H%(I,J)>H%(I,J+K)S=H%(I,J):H%(I,J)=H%(I,J+K):H%(I,J+K)=S
l ::
v:showhand:131:X=8:Y=3:I=1 5:X,Y)21," "):Y=Y+1:
4X=320:Y=930:Y1=766:I=1 9:X,Y:6,X,Y1:X=X+64:
(128:I=0 9:pcard(1,I,H%(1,I))::
*scoresort(I,A):K=A 1 -1:J=0 A-K
S%(J)>=S%(J+K)t|G
#S=S%(J):S%(J)=S%(J+K):S%(J+K)=S
+S=H%(I,J):H%(I,J)=H%(I,J+K):H%(I,J+K)=S
::
prqsrpqss9P90 L9GIN.R#M%GIN.RO .
~~