i made a tic-tac-toe game its a 1player game with AI.
o's stand for comp being on offence, and d's stand for
the comp being on defence. you can edit this program anyway u like but if u edit it and send it back out to the public please give me credit.
thanx.
`-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>
`>>>>>>>>>>>>>>>>>>>>>>>>>>>>
hide mouse
sync on
line 200,0,200,300
line 100,0,100,300
line 0,200,300,200
line 0,100,300,100
get image 1,0,0,301,301
cls
line 0,0,90,90
line 90,0,0,90
get image 2,0,0,91,91
cls
circle 45,45,45
get image 3,0,0,91,91
cls
line 10,0,10,20
line 0,10,20,10
get image 4,0,0,21,21
cls
dead:
wait 1000
a=0:b=0:c=0:d=0:e=0:f=0:g=0:h=0:i=0
aa=0:bb=0:cc=0:dd=0:ee=0:ff=0:gg=0:hh=0:ii=0:
q2=rnd(1)
done = 0
klik = 0
q = 0
fin = 0
sprite 4,x,y,4:offset sprite 4,10,10
paste image 1,170,90
if q2=1 then gosub ai
do
x = mousex()
y = mousey()
sprite 4,x,y,4
if x>170 or y>90 or x1 and aa1) and x170 and y90 then paste image 2,175,95:a=1:fin=1
if (b1 and bb1) and x270 and y90 then paste image 2,275,95,2:b=1:fin=1
if (c1 and cc1) and x370 and y90 then paste image 2,375,95,2:c=1:fin=1
if (d1 and dd1) and x170 and y190 then paste image 2,175,195,2:d=1:fin=1
if (e1 and ee1) and x270 and y190 then paste image 2,275,195,2:e=1:fin=1
if (f1 and ff1) and x370 and y190 then paste image 2,375,195,2:f=1:fin=1
if (g1 and gg1) and x170 and y290 then paste image 2,175,295,2:g=1:fin=1
if (h1 and hh1) and x270 and y290 then paste image 2,275,295,2:h=1:fin=1
if (i1 and ii1) and x370 and y290 then paste image 2,375,295,2:i=1:fin=1
klik = 0
if fin = 1 then gosub ai
if (a=1 and b=1 and c=1) or (d=1 and e=1 and f=1) or (g=1 and h=1 and i=1) or (a=1 and d=1 and g=1) or (b=1 and e=1 and h=1) or (c=1 and f=1 and i=1) or (a=1 and e=1 and i=1) or (c=1 and e=1 and g=1)
print "YOU WIN!!!":goto dead
endif
if (aa=1 and bb=1 and cc=1) or (dd=1 and ee=1 and ff=1) or (gg=1 and hh=1 and ii=1) or (aa=1 and dd=1 and gg=1) or (bb=1 and ee=1 and hh=1) or (cc=1 and ff=1 and ii=1) or (aa=1 and ee=1 and ii=1) or (cc=1 and ee=1 and gg=1)
print "YOU LOSE":goto dead
endif
endif
return
ai:
done = done + 1
if done = 5 then print "Cat Game":goto dead
`offence
if (q = 1 or q = 2) and (a1 and aa1) and ((bb=1 and cc=1) or (dd=1 and gg=1) or (ee=1 and ii=1)) then paste image 3,175,95,3:aa = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (b1 and bb1) and ((aa=1 and cc=1) or (ee=1 and hh=1)) then paste image 3,275,95,3:bb = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (c1 and cc1) and ((aa=1 and bb=1) or (ff=1 and ii=1) or (ee=1 and gg=1)) then paste image 3,375,95,3:cc = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (d1 and dd1) and ((ee=1 and ff=1) or (aa=1 and gg=1)) then paste image 3,175,195,3:dd = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (e1 and ee1) and ((dd=1 and ff=1) or (bb=1 and hh=1) or (aa=1 and ii=1) or (cc=1 and gg=1)) then paste image 3,275,195,3:ee = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (f1 and ff1) and ((dd=1 and ee=1) or (cc=1 and ii=1)) then paste image 3,375,195,3:ff = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (g1 and gg1) and ((hh=1 and ii=1) or (aa=1 and dd=1) or (ee=1 and cc=1)) then paste image 3,175,295,3:gg = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (h1 and hh1) and ((gg=1 and ii=1) or (bb=1 and ee=1)) then paste image 3,275,295,3:hh = 1:klik=1
if (q = 1 or q = 2) and klik=0 and (i1 and ii1) and ((gg=1 and hh=1) or (cc=1 and ff=1) or (aa=1 and ee=1)) then paste image 3,375,295,3:ii = 1:klik=1
`deffence
if (q = 0 or q = 1) and klik=0 and (a1 and aa1) and ((b=1 and c=1) or (d=1 and g=1) or (e=1 and i=1)) then paste image 3,175,95,3:aa = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (b1 and bb1) and ((a=1 and c=1) or (e=1 and h=1)) then paste image 3,275,95,3:bb = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (c1 and cc1) and ((a=1 and b=1) or (f=1 and i=1) or (e=1 and g=1)) then paste image 3,375,95,3:cc = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (d1 and dd1) and ((e=1 and f=1) or (a=1 and g=1)) then paste image 3,175,195,3:dd = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (e1 and ee1) and ((d=1 and f=1) or (b=1 and h=1) or (a=1 and i=1) or (c=1 and g=1)) then paste image 3,275,195,3:ee = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (f1 and ff1) and ((d=1 and e=1) or (c=1 and i=1)) then paste image 3,375,195,3:ff = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (g1 and gg1) and ((h=1 and i=1) or (a=1 and d=1) or (e=1 and c=1)) then paste image 3,175,295,3:gg = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (h1 and hh1) and ((g=1 and i=1) or (b=1 and e=1)) then paste image 3,275,295,3:hh = 1:klik=1
if (q = 0 or q = 1) and klik=0 and (i1 and ii1) and ((g=1 and h=1) or (c=1 and f=1) or (a=1 and e=1)) then paste image 3,375,295,3:ii = 1:klik=1
`neither defence nor offence
if klik=0 and (e1 and ee1) then paste image 3,275,195,3:ee = 1:klik=1
if klik=0 and (a1 and aa1) then paste image 3,175,95,3:aa = 1:klik=1
if klik=0 and (c1 and cc1) then paste image 3,375,95,3:cc = 1:klik=1
if klik=0 and (g1 and gg1) then paste image 3,175,295,3:gg = 1:klik=1
if klik=0 and (i1 and ii1) then paste image 3,375,295,3:ii = 1:klik=1
if klik=0 and (b1 and bb1) then paste image 3,275,95,3:bb = 1:klik=1
if klik=0 and (d1 and dd1) then paste image 3,175,195,3:dd = 1:klik=1
if klik=0 and (f1 and ff1) then paste image 3,375,195,3:ff = 1:klik=1
if klik=0 and (h1 and hh1) then paste image 3,275,295,3:hh = 1
q=rnd(2)
if q=0 then print "d-";
if q=1 then print "?-";
if q=2 then print "o-";
return
If practice makes perfect and no1s perfect y practice?
.....:::<>-<K0shi>-<>:::.....