BCKGINSBCKG BCKGINS!BOOT 3 <0*BASIC
PAGE=&1900
*FX21
CLOSE#0:CHAIN "BCKGINS"
# Backgammon: Traditional Games
# Presented by Gemini Games Ltd
# Copyright D.K.Barker-Hahlo 82
(
2*FX200,3
<dBA
F7:23;8202;0;0;0;
PS" Backgammon by D.K.Barker-Hahlo Backgammon by D.K.Barker-Hahlo"
Z'"EQUIPMENT:":*FX200,2
d"The board is divided into two halves, the INNER and the OUTER, by a vertical line or hinge, known as the BAR. Each half is divided into two, making four sections, and each of these consists"
n"of 6 POINTS - i.e 24 Points in all. You have one Inner and Outer, your opponent the other. Your Inner is the bottom left section, the computer's the top left. You play clockwise."
x"THE PIECES. (Sometimes referred to as Stones). Each player has 15 pieces, which start the game in the layout shown on the screen. You have 5 in yourInner on Point 6, 3 in your Outer on"
|"Point 8, 5 in the computer's Outer on Point 13, and 2 in his Inner on Point 24. His pieces exactly mirror yours."
/'" Press SPACE BAR to continue...":*FX15
=32:28,0,22,39,2::*FX15
'"THE DICE. A pair of dice is used to decide the move of the pieces. Each player has his own pair. A further single dice, numbered 2, 4, 8, 32 and 64 is used to display the current stake for the game."
'"RULES:"
"The object of the game is to work all your pieces into your Inner, and then remove them from the board, before youropponent can do so."
"STARTING. Each player throws one dice. If the result is a double, the stakes for the game are doubled, and the dice is thrown again, until the dice are different. The winner starts, and has"
B"the choice of using the dice as thrown,or throwing again."
=32::*FX15
'"DIRECTION OF PLAY. Your pieces move from your opponent's Inner, via his Outer, then your Outer, into your Inner. You may find you already have some pieces apparently 'home'."
"MOVING. The dice are thrown, and will display two separate figures. Subject to certain limitations, any piece may be moved forward the number of Points given by one dice, then the same or"
"another piece moved the number given by the other dice. If the throw was a 'double', i.e. both the same, you have not two moves to make, but four."
"MAKING A POINT. Any Point which is occupied by two or more of a player's piece is MADE by that player. His opponent may not move a piece onto such a Point."
=32::*FX15
'"HITTING. Conversely, if a Point is occupied by a single piece, the piece is known as a BLOT, and may be HIT by the opponent by his moving a piece ontothe Point. If this happens, the Blot goes to the Bar."
"RE-ENTERING. If you have a piece on theBar, you must get it back into play by re-entering via your opponent's Inner, before you may move any other piece."
"S"THE OBLIGATION TO MOVE. You MUST use the dice thrown if at all possible."
,"BEARING OFF. Once all your pieces have moved into your Inner, you may start to BEAR OFF, or remove them. A 1 thrownallows you to remove a piece from the 1 Point and so on up to the 6 Point."
6F"Once one player has born off all his pieces, the game ends."
@=32::*FX15
J'"GAMMON AND BACKGAMMON. If, at the finish, of play, the loser has failed to bear off any piece, the stake is doubled, for GAMMON. Should he not onlyhave failed to bear off a piece, but"
T"also have one or more pieces remaining in the winner's Inner, or on the Bar, the stakes are tripled, for BACKGAMMON.";
^"THE DOUBLING DICE. At the start of the game, the Doubling Dice belongs to neither player. If the stakes are stillsingle it will not be present on the table. If there was a double thrown"
h"at the start, it will reveal the stake.If either player wishes, he may, at thestart of his turn and before throwing the dice, suggest to his opponent that"
rS"the stakes for the game be doubled. Theother player may refuse, but loses."
|=32::*FX15
'"OPERATING THE GAME:"
"At the top of the screen, you will see a reminder of the symbols used by the computer to display the pieces - yours 'O', its 'X'. The points are numbered"
"from 1 to 24. The Bar is 25, but this is not displayed. A piece sent to the Bar will appear on the white vertical line in the middle of the board."
"The areas on either side of the Bar, between points, are used for various messages, on the left, the current stake for the game, on the right the dice thrown. Other messages appear at the bottom of the screen."
"At the end of a game, the result is displayed with the running total so far, and you are invited to play"'"again."
=32
*FX200,3
26,12,28,0,0,0,0
*RUN"BCKG"
x9B%(25),R%(5),N$(1),F(1):@%=3:M=0:rtot=0:SC=0:DXB
-N$(0)=" I ":N$(1)="You":I=025:B%(I)=0:
LB%(1)=2:B%(6)=-5:B%(8)=-3:B%(12)=5:B%(13)=-5:B%(24)=-2:B%(19)=5:B%(17)=3
3X=(-):23,255,255,255,255,255,255,255,255,255
81:19,0,4,0,0,0:OFF:board:ddice%=-1:d%=0:*FX200,2
I%=124:B%(I%)stones(I%)
:start
!st%M=0st%=0:M=1:RR%=2:d\@
st%st%=0:M=0:RR%=2:DrA
turn:d%dVAM=0DrA
ON:K=1
CWB:10,28)"Which Piece to move?"':12)"25=Bar N=No Move "A$
A$="N"A$="n"K=RR%:DhA
P=(A$):P<1P>25E:dp@
B%(P)>-1E:dp@
"2WB:11,30)"Dice throw used "D:D<1D>6TbA
6F%=0:N=P-D:N<1F%=1
@OK:F E:dp@
J.R%(D%)=0:B%(P)=B%(P)+1:stones(P):F%DhA
T>B%(N)=1B%(N)=-1:B%(0)=B%(0)+1:7:stones(0)B%(N)=B%(N)-1
^stones(N)
h15THB
J=0:L=6:M=0J=19:L=25
B=2:I=J L:B%(I)<>0B=3:I=L
B=B*SC:W%=1 B=-B
7rtot=rtot+B:WB:10,28)"Game over"(B)" to "N$(W%)
*S$="You owe me":rtot<0 S$="I owe you"
&rtot=0S$="All square"
0 4,30)S$;:rtot<>0(rtot);
:" Another game?"
DYN tB@
N!-4
X*FX200,3
b;=17 WB:OFF:0,28)"You pressed Escape.";:TzB
lOK:F=0:B%(25)P<>25F=1:
vF%N<1tJB
B%(N)>1F=1:
"F=1:L=1RR%:R%(L)=D F=0:D%=L
:F F%=0
I=725:B%(I)<0F=1
:F D<=P
I=P+1 6:B%(I)<0N<0F=1
:
E:0,30)(39)
C17,0,17,129,7,7:14,30)"Invalid Move":I=(300):17,3,17,128:
ݤcheck:d% =
W%=1:T=025:B%(T)<0W%=0
:W% =
W%=0:T=025:B%(T)>0W%=1
:W%=0 = =
turn:M=0M=1M=0
double:d%
L=14:R%(L)=0::RR%=2:R
*-R%(2)=R%(1)R%(3)=R%(1):R%(4)=R%(1):RR%=4
4+R%(2)>R%(1)A=R%(1):R%(1)=R%(2):R%(2)=A
>RT%=R%(1)+R%(2)
H'WM:21,14)N$(M)" threw"R%(1)R%(2)
R%M=0key:13,30)"Just a Moment."
\
f#WM:I=13 15:20,I)(18)::
pWB:0,28)(119):
zstart:SC=1:st%=0
R
520,13)"I threw You threw"22,15)R%(1)(5)R%(2)
R%(1)=R%(2)SC=SC*2
+3,14)"Stake"SC:R%(1)=R%(2)key:tDC
R%(1)A$="You to start.":M=0
0,28)A$;:M dTC
+" Do you want this throw?":YN st%=1
#R%(1)=6(R%(2)=5R%(2)=1)st%=1
R%(1)=3R%(2)=1st%=1
st%" I shall use these"
key:WM:WB:
)key:15,30)"Press a Key":G=:WB:
ON:23;&670A;0;0;0;:
OFF:23;&200A;0;0;0;:
*ݤYN:G=223:G=78G=89:G=89 = =
$"double:M<>ddice%ddice%>-1
.M ddice%<>0DVD
830B1>A1-5)(A1>10B1>A1-2)(A1<=10B1>A1+1) block a%=
jDa%SC=SC*2:ddice%=0:8,14)SC W%=1:d%=:WM:24,14)"Resigning"
t
~ݤblock:C1=0:I=0:
I=I+1:B%(I)<-1I>11
4C=0:I=I+1:C=C+1:B%(I)>-2I>11:C>C1 C1=C:P=I-1
I>11:C1<5 =
C=:I=P 0-1:B%(I)>0C=
:=C
offer:offer%=:a%=
M dbD
3WM:24,13)"Doubling!!"22,15)"Do you accept?"
a%=YN:WM:
0,28)(39)16)"Doubling?"
offer%=YN:
board:A$=255:
)5,1)"O = You BACKGAMMON X = Me"
+0,3)39,A$):I=121:A$19)25538)A$
":39,A$):I=124:point(I):
60,3:5:X=-80:Y=956:I=2413-1:X=X+96:I=18X=X+32
(
X,Y:I:
25X=-96:Y=186:I=112:X=X+96:I=7X=X+32I=10X=X+16
<X,Y:I::4:
Fpoint(A):C=1:A 2C=2
PA=0A=25tBE
Z#X=-65+96*A:A>12 X=31+96*(24-A)
dA>6A<19X=X+32
n!Y=224:Z=288:A>12Y=896:Z=-288
x$0,C:X,Y:X+48,Y+Z:85,X+96,Y:
A=0B=5:C=12B=16:C=21
I=B C:19,I)255::
R:I=1 2:R%(I)=(6)::
ݤTOT: F
RR%=0 =
F=0:I=1RR%:R%(I)=0F=I
:F=0 =
3J=F RR%-1:R%(J)=R%(J+1)::R%(RR%)=0:RR%=RR%-1
RT%=R%(1)+R%(2):tjE
8stones(A):point(A):B%=B%(A):C%=(B%):C%>7C%=C%+1
!S$="O":B%>0S$="X"B%=0S$=""
A=0A=25TvF
%T=3+((24-A)*3):A<13T=3+((A-1)*3)
A>18A<7T=T-1
Y=3:A<13Y=25
I=1C%:C%>7I=C%S$=" "
"A<13T,Y-I)S$T,Y+I)S$
,:
6Y=12:T=19:A=25Y=16
@ TXF
J
in:P%=0
TF=0:B%(0)=0TOT
^.L=1RR%:N%=R%(L):B%(N%)=-1hit:F=1:L=RR%
h:F DTF
r/L=1RR%:N%=R%(L):B%(N%)>-1move:F=1:L=RR%
|:F DTF
"state:A=0:B=0:A1=0:B1=0:FF=1
I=025:I>18B%(I)>1A=A+1
I<7B%(I)<-1B=B+1
'B%(I)>0A1=A1+(((25-I)/6)+1)*B%(I)
"B%(I)<0B1=B1+((I/6)+1)*B%(I)
:B1=(B1):B-A>1B>4FF=3
A>3B<4FF=4
A1-B1>5B1>9B<5FF=5
ff:
$ff:I=-1:I=I+1:B%(I)>0:F(0)=I
I=26:I=I-1:B%(I)<0:F(1)=I
F(0)>F(1)FF=2
ݤin:ff:F(0)>18 = =
Smove:blink:B%(P%)=B%(P%)-1:B%(N%)=B%(N%)+1:R%(L)=0:stones(N%):stones(P%):
7bear:blink:B%(P%)=B%(P%)-1:R%(L)=0:stones(P%):
&Ahit:blink:B%(N%)=1:B%(25)=B%(25)-1:B%(P%)=B%(P%)-1:R%(L)=0
0,stones(N%):stones(25):stones(P%):7:
5%blink:Z%=1 15:stones(P%)::
:
comb
DF=0:X=TOT:RR%<2
ND%=R%(1)-R%(2):R%=R%(2)
X&N%=1824:B%(N%)>0B%(N%)<-1DlG
btry:F N%=24
l:F DDG
v+N%=18F(0)-1:B%(N%)>0B%(N%)<-1tJG
try:F N%=F(0)
:F DDG
,try:F=0:J%=N%-R%:K%=J%-D%:J%>24K%<1
B%(J%)<1B%(K%)<1
J%-R%(1)<1t|G
HRR%>2(B%(J%)=3B%(J%)=1)B%(J%-R%)>2P%=J%-R%:N%=J%:L=1:move:F=1:
%J%=K%(J%>18B%(J%)=3B%(J%)<2)
'(B%(J%)=2J%>17)(B%(K%)=2K%>17)
B%(J%)=2B%(K%)=2J%<>K%
#P%=J%:L=1:B%(N%)=-1hit move
P%=K%:L=2:move:F=1:
att:TOT
F=0:A=18:FF=5A=F(1)
"N%=1A:B%(N%)<>-1N%=25DHH
+L=1RR%:P%=N%-R%(L):R%(L)=0P%<1T`H
;B%(P%)=1B%(P%)>2(B%(P%)=2(FF=4FF=5))hit:L=RR%:F=1
&:F N%=A:DHHX=TOT:RR%<2DHH
*'P%=N%-RT%:P%<1DHHB%(P%)<1DHH
4CI=12:B%(P%+R%(I))>-1N%=P%+R%(I):L=I:move:RT%=0:N%=A:F=1:I=2
>
HN%:F dxG
Rdef:F=0:FF=2TOT
\/J%=241-1:(J%<19J%>F(1))B%(J%)<>1tXH
f+L=1RR%:P%=J%-R%(L):R%(L)=0P%<1DzH
p+B%(P%)=1B%(P%)>2N%=J%:move:L=RR%:F=1
z7:F tXHL=1RR%:N%=J%+R%(L):N%>24R%(L)=0tNH
B%(N%)>0P%=J%:move:L=RR%
J%:
amm:TOT
N%=1322:B%(N%)<>2dTH
L=1RR%:R%(L)=0dJH
-P%=N%-R%(L):B%(P%)>3B%(P%)=1move:L=RR%
N%:
any(A,B): F
F=1:TOT
P%=A B:B%(P%)<1TnI
,L=1RR%:N%=P%+R%(L):N%>24R%(L)=0TdI
B%(N%)<-1TdI
B%(N%)=-1hit move
L=RR%:P%=23:in%=in:F=0
$
.:F in%bearoff:dhH
8FF=2FF=5dhHdef:dhH
B
Ldesp:TOT
V(TOT F=0:P%=112:B%(P%)<3DtI
`8L=1RR%:N%=P%+R%(L):B%(N%)>-1move:L=RR%:P%=12:F=1
j
t:F DVI
~def:any(12,17):
'run:F=0:I=16:B%(I)>0I>F(1)F=1
:F any(F(0),23):
P%=1318:L=RR%1-1
,N%=P%+R%(L):N%>18B%(P%)>0move:in%=in
in%L=1:P%=18
#::in%bearoff any(F(0),23)
hold:TOT
L=1RR%:R%(L)=0T@J
0P%=F(0)23:N%=P%+R%(L):N%>24B%(P%)<3dvI
B%(N%)>0move:P%=23
:
bearoff
TOT check
L=1:P%=18:P%=P%+1:B%(P%)>0
("N%=P%+R%(L):N%>24bear:TTJ
2$ff:FF=1FF=3def:hold:TOT
<5F=0:L=1RR%:P%=25-R%(L):B%(P%)>0bear:L=RR%:F=1
F:TOT F TrJ
P+X=TOT:P%=25-RT%:B%(P%)<1 RR%<2 DdJ
Z?B%(P%+R%(1))>-1B%(P%+R%(2))>-1bear:R%(1)=0:R%(2)=0:TrJ
dN%=F(0)24:B%(N%)<>0tBJ
n-L=1RR%:P%=N%-R%(L):B%(P%)>1move:L=RR%
x
:
prqsrpqss<P<0 L<BCKGgm;BCKGO .