HEXLOADHEX HEXLOAD!BOOT 3 *;0*BASIC
PAGE=&1900
*FX21
CLOSE#0:CHAIN "HEXLOAD"
Hex! Loader
By Adrian Jackson
(c) The Micro User
(1
223;8202;0;0;0;
<TlA:*FX200,3
F:Z$,R
PR
ZZ$="?"Z$:(40Z$)/2,);
d@Z$="*"14,30);:text("Press Space"):("FX15"):=" "::0
nZ$="@"tL@
x
text(Z$)
Z$="@"
=&1700:"HEX"
text(A$)
A$=0
A%=10:X%=&70:Y%=0
B%=1A$
?&70=(A$,B%,1))
?&70=32 32::
&FFF1
%N%=07:N%?&71=N%?&71 2*N%?&71:
R=1 ?&78=255
23,255
N%=07:N%?&71:
255
"
,?,1,"Welcome to HEX!","",1,"Welcome to HEX!, a game of strategy,",2,"skill, and hexcitement for two players",2,"who will need all their intelligence",2,"and hexperience to win the game.",2,"",3
6"The rules are simple enough. You take itin turns to fill in hexagons on the HEX!grid, and the winner is the first to",3,"complete a line.",3,"",2,"Player one plays with blue hexagons, andmust complete a line between the blue",2
@u"sides of the HEX! grid. Player two playswith pink hexagons, and must complete a line between the pink sides.",2
J"",2,"Despite the seeming simplicity of the",3,"game, it is hextremely difficult to win all the time. It has been proved that a strategy exists, but nobody has ever",3,"managed to find it.",3
T"",2,"It isn't much of an hexaggeration to saythat this is probably the best puzzle",2,"game for two players since noughts and",2,"crosses, and it certainly has more",2,"lasting appeal.",2
^
"*",3
h?,1,"Some Hints on Strategy","",1,"If you have two of your hexes arranged",2,"so that two empty spaces touch both of",2,"them, this is a safe joint, as if your",2,"opponent fills one, you can immediately fill the other.",2
r"",1,"Make sure you don't concentrate just on making your own line, or your opponent",3,"will have plenty of time to make theirs.Stick your hexes in the way.",3,*,2
G?,1,Keys,"",2,"",2,?,2,"A *","",2,?,3,x,"",2,?,2,"Z ?","",2,""
x3,"",2,"",2,"Now press space to load HEX! and start playing.",2,"",1,"",1,"Good Luck!  You'll need it.",3,*,2,@,2
Hex!
By Adrian Jackson
(c) The Micro User
( ===================
2 7:error:
<
setup
F=1:19,2,5,0,0,0,19,1,4,0,0,0,23;8202;0;0;0;:board:init
P):move:check:won>0:won(won):DF@
Zhex(hx,hy,hs,hc)
d0,3
nahx,hy:hx+2*hs,hy+2*hs:hx+5*hs,hy+2*hs:hx+7*hs,hy:hx+5*hs,hy2*hs:hx+2*hs,hy2*hs:hx,hy
xOhc=0 0,hc: hz=hy+2*hs4 hy2*hs+4 4: hx+4*hs,hz:77,hx+4*hs,hz:
board
bp=1 11: bd=1 11
>hex(605+(bp1)*50(bd1)*50,100+(bd1)*20+(bp1)*20,10,0)
::0,2
M20,0:0,20:0,1000:20,1020:1259,1020:1279,1000:1279,20:1259,0:20,0
I28,8:8,28:8,576:28,596:1251,596:1271,576:1271,28:1251,8:28,8
S28,604:8,624:8,992:28,1012:1251,1012:1271,992:1271,624:1251,604:28,604
0,3
ܘTbA:dl=16:lb,C%,D%:C%,D%:0,3:ld=1lb:A%,B%:A%,B%::C%,D%:nf:0,1:ld=1nf:A%,B%,C%,D%:fl=B%D%:77,A%+(flB%)*(C%A%)/(D%B%),fl:::
105,300:0,2:A%=111:1,20,20:1,30,0::0,1:A%=110:1,20,20:1,30,0::1,20,20:0,2:A%=111:1,20,20:1,30,0::0,1:A%=110:1,20,20:1,30,0:
1,20,20
rhex(350,880,25,1):hex(350,760,25,2):700,836:0,3:5:"TO PLAY":692,844:924,844:924,800:692,800:692,844
n0,3:A%=8807605:692,800:525,A%::A%=8807605:692,844:525,A%::A%=8807605:465,820:525,A%:
TbA:dl=16:lb,C%,D%:C%+940,D%:0,3:ld=1lb:A%,B%:A%+940,B%::C%+940,D%:nf:0,2:ld=1nf:A%,B%,C%,D%:fl=B%D%:77,940+A%+(flB%)*(C%A%)/(D%B%),fl:::
tune(700):
"3,250,704,250,992,300,992,300,704,1,254,708,254,988,3,250,694,250,640,300,640,300,694,1,254,644,254,690,11,40,992,40,880,130,880,130,925,150,925,150,880,240,880,240,992,150,992,150,947,130,947,130,992,2,44,884,44,988,174,884,174
,988,11,40,870,240,870,240,840,100,840,100,830,240,830,240,800,100,800,100,790,240,790,240,760,40,760,1,44,764,44,866,11,40,750,110,750,140,725,170,750,240,750,170,695,240,640,170,640,140,665,110,640,40,640,110,695,2,50,644,230
6G746,230,644,50,746,3,40,632,40,624,300,624,300,632,1,44,628,44,629
@Swon(Z%):T=+750::19,1,5,0,0,0,19,2,4,0,0,0,19,1,4,0,0,0,19,2,5,0,0,0:>T:
JA%=14:hex(A%*300235,600,30,1)::A%=13:hex(A%*30085,540,30,2)::A%=12:hex(A%*300+65,420,30,3)::hex(515,360,30,3)
T3,3:5:A%=14:A%*300146,616:"PAE"+Z%,A%,1)::A%=13:A%*300+4,556:"LYR",A%,1)::A%=12:A%*300+154,436:"WN",A%,1)::604,376:"O"
^JT=+750::19,1,5,0,0,0,19,2,4,0,0,0,19,1,4,0,0,0,19,2,5,0,0,0:>T:4
htune(670)
rv1:8,25);"Press ";:2:;" ";:1:;"to play."::19,1,5,0,0,0,19,2,4,0,0,0,19,1,4,0,0,0,19,2,5,0,0,0:99

Msetup:board(10,10),check(10,10):1,1,0,0,0,0,0,0,126,1,0,3,126,126:
7init:A%=010:B%=010:board(A%,B%)=0:::won=0:
4move:move1(1):check:won>0 tdA move1(2)
check
NA%=12:B%=010:C%=010:board(B%,C%)=A% check(B%,C%)=1 check(B%,C%)=0
Y::B%=010:A%=1 check(0,B%)=1 check(0,B%)=2 A%=2 check(B%,0)=1 check(B%,0)=2
6::D%=0:B%=010:C%=010:check(B%,C%)=2 search
::D%=0
DB%=010:(A%=1 check(10,B%)>1)(A%=2 check(B%,10)>1) won=A%
:
Vsearch: T\B:F%=05:f%,g%:b%=B%f%:c%=C%g%: b%<0 b%>10 c%<0 c%>10 :
*check(b%,c%)=1 check(b%,c%)=2:D%=D%+1
:
1,0,1,1,0,1,0,1,1,1,1,0
&Tmove1(H%):B%=0:C%=0:0,H%:700,836:5:"TO PLAY":425,772120*(H%=1):3,3:"*"
083,3::675+B%*50(C%+1)*50,100+(C%+1)*20+B%*20:"."
:T=+10:>T
Di73 105 99 66 98:675+B%*50(C%+1)*50,100+(C%+1)*20+B%*20:".":73B%<10 B%=B%+1
N105B%>0 B%=B%1
X66C%<10 C%=C%+1
b98C%>0 C%=C%1
ld99 board(B%,10C%)=0:0,1,5,2:hex(605+B%*50C%*50,100+C%*20+B%*20,10,H%):board(B%,10C%)=H%
v?0,3:700,836:5:"TO PLAY":425,772120*(H%=1):3,3:"*":
0tune(M%):M%::L%=13:J%,K%:K%=0 tTB
*J%=0 K%<>0 L%,0,J%,K% L%,1,J%,K%
:J%=0 K%=1:
c0,8,0,8,33,8,157,4,145,8,81,16,145,4,117,8,81,8,149,8,0,0,0,0,145,4,109,4,0,0,137,8,101,8,41,8
X117,28,101,28,69,8,0,0,0,0,89,4,0,0,0,0,81,4,0,0,0,0,77,4,0,0,0,0,69,4,0,8,0,8,61,8
d137,4,125,24,101,16,129,4,0,0,0,0,145,8,0,0,0,0,137,8,0,0,101,8,129,32,109,32,97,32,0,1,0,1,0,1
@129,4,97,16,69,8,129,4,0,0,0,0,129,4,0,0,61,8,137,4,0,0,0,0
u145,8,117,16,53,12,145,8,0,0,53,4,137,4,101,16,61,12,129,4,0,0,0,0,137,8,0,0,61,2,129,32,97,32,0,2,0,0,0,0,61,32
0,1,0,1,0,1
error::" at line ";: