La NSCPapy Logo présente :
Logo-
XO
de Sébastien Magdelyns

Sans avoir lu la page d'Introduction ni celle des commentaires sur les procédures ; vous risquez de graves erreurs...


DONNE "fin 0
DONNE "ls 100
DONNE "cs 100
DONNE "l1 150
DONNE "l2 50
DONNE "l3 -50
DONNE "l4 -150
DONNE "c1 -150
DONNE "c2 -50
DONNE "c3 50
DONNE "c4 150
DONNE "grid [-1 -1 -1 -1 -1 -1 -1 -1 -1]
DONNE "patternsize 40
DONNE "i 0

POUR LOGOXO

RECYCLE
FEN
VT
ME 5

DONNE "fin 0
DONNE "grid [-1 -1 -1 -1 -1 -1 -1 -1 -1]

DRAWGRID
ECRIS [Bienvenue dans Logo-Xo. Utilise la touche "X" et aligne 3 croix sur la grille.]

SI EGAL? 1 HASARD 2 [DRAWROBOT 7 DRAWRING DRAWROBOT 0][]

FCC 15

REPETE 1000 [RECYCLE SI PLG? :fin 0 [RECYCLE STOP] [DONNE "cmd LL SI VIDE? :cmd[][SI ET EGAL? COMPTE :cmd 1 EGAL? ASCII ITEM 1 :cmd 88 [CROSS][SI ET LISTE? :cmd EGAL? COMPTE :cmd 2 [SI ET PLG? ASCII ITEM 1 :cmd 47 PLP? ASCII ITEM 1 :cmd 58 [][SI PRIM? ITEM 1 :cmd [SI NOMBRE? ITEM 2 :cmd [EXECCMD :cmd]]]]]]]]

SI EGAL? :fin 0 [ECRIS [Desole, tu n'as que 1000 coups pour gagner.] RECYCLE LOSE]

FIN

POUR EXECCMD :cmd
DRAWGRID
EXEC :cmd
CHKOUTSCREEN
FCC 15
FIN

POUR CROSS
RECYCLE

DONNE "lpos GETPOS
DONNE "available 1
DONNE "cell 0

SI ET NEGAL? ITEM 1 :lpos -1 NEGAL? ITEM 2 :lpos -1 [DONNE "cell SOMME :casex PROD 3 DIFF :casey 1 SI NEGAL? ITEM :cell :grid -1 [DONNE "available -2]][DONNE "available -1]

SI EGAL? :available -1 [ECRIS [La tortue n'est pas sur la grille!] STOP]
SI EGAL? :available -2 [ECRIS [La case est deja occupee!] STOP]
SI EGAL? :available 1 [DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 12]

RECYCLE

DONNE "i 1
DONNE "newgrid []
REPETE 9 [SI EGAL? :i :cell [DONNE "newgrid MD 1 :newgrid][DONNE "newgrid MD ITEM :i :grid :newgrid] DONNE "i SOMME :i 1]
DONNE "grid :newgrid

DONNE "win CHKWIN 1

SI OU NEGAL? 0 ITEM 1 :win NEGAL? 0 ITEM 2 :win [DRAWWIN :win 0 WIN STOP]

SI EGAL? :available 1 [DRAWROBOT 7 DRAWRING DRAWROBOT 0]

DONNE "win CHKWIN 2
SI OU NEGAL? 0 ITEM 1 :win NEGAL? 0 ITEM 2 :win [DRAWWIN :win 1 LOSE STOP]

DONNE "i 1
DONNE "exaequo 1
REPETE 9 [SI EGAL? -1 ITEM :i :grid [DONNE "exaequo 0][] DONNE "i SOMME :i 1]
SI EGAL? 1 :exaequo [EXAEQUO]

RECYCLE
FIN

POUR DRAWWIN :win :ring

SI EGAL? 0 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i ITEM 1 :win DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI EGAL? 0 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i ITEM 1 :win DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 9][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 12]]]
SI EGAL? 0 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i ITEM 1 :win DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI EGAL? 0 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i ITEM 1 :win DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15]]]

SI EGAL? 0 ITEM 1 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE ITEM 2 :win :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI EGAL? 0 ITEM 1 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE ITEM 2 :win :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 9][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 12]]]
SI EGAL? 0 ITEM 1 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE ITEM 2 :win :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI EGAL? 0 ITEM 1 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE ITEM 2 :win :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15]]]

SI ET EGAL? -1 ITEM 1 :win EGAL? -1 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI ET EGAL? -1 ITEM 1 :win EGAL? -1 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 9][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 12]]]
SI ET EGAL? -1 ITEM 1 :win EGAL? -1 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI ET EGAL? -1 ITEM 1 :win EGAL? -1 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15]]]

SI ET EGAL? -2 ITEM 1 :win EGAL? -2 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE DIFF 4 :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI ET EGAL? -2 ITEM 1 :win EGAL? -2 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE DIFF 4 :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 9][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 12]]]
SI ET EGAL? -2 ITEM 1 :win EGAL? -2 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE DIFF 4 :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 0]]]
SI ET EGAL? -2 ITEM 1 :win EGAL? -2 ITEM 2 :win [DONNE "i 1 REPETE 3 [DONNE "lpos LISTE DIFF 4 :i :i DONNE "i SOMME :i 1 SI EGAL? 1 :ring [DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15][DRAWCROSS SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 15]]]

FIN

POUR CHKOUTSCREEN
SI OU OU OU PLP? ITEM 1 POS -318 PLP? ITEM 2 POS -190 PLG? ITEM 1 POS 318 PLG? ITEM 2 POS 190 [REPLACE]
FIN

POUR REPLACE

DONNE "dir VERS LISTE 0 0
DONNE "alpha DIFF :dir 180

SI PLP? :alpha 0 [DONNE "alpha SOMME 360 :alpha]
SI PLG? :alpha 360 [DONNE "alpha DIFF :alpha 360]

DONNE "xa ITEM 1 POS
DONNE "ya ITEM 2 POS
LC
AV 500
DONNE "xb ITEM 1 POS
DONNE "yb ITEM 2 POS
RE 500
BC

SI OU EGAL? 0 DIFF :yb :ya EGAL? 0 DIFF :xb :xa [DONNE "m 0 DONNE "minv 0][DONNE "m DIV DIFF :yb :ya DIFF :xb :xa DONNE "minv DIV DIFF :xb :xa DIFF :yb :ya]

SI OU PLG? :alpha 300.8 PLP? :alpha 59.2 [FPOS LISTE SOMME :xa PROD DIFF 190 :ya :minv 190]
SI ET PLG? :alpha 59.2 PLP? :alpha 120.8 [FPOS LISTE 318 SOMME :ya PROD DIFF 318 :xa :m]
SI ET PLG? :alpha 120.8 PLP? :alpha 239.2 [FPOS LISTE SOMME :xa PROD DIFF -190 :ya :minv -190]
SI ET PLG? :alpha 239.2 PLP? :alpha 300.8 [FPOS LISTE -318 SOMME :ya PROD DIFF -318 :xa :m]

ECRIS [Attention, la tortue sort de l'ecran!]
FIN

POUR GETPOS
DONNE "posx ITEM 1 POS
DONNE "posy ITEM 2 POS

SI PLP? :posx :c1 [DONNE "casex -1][SI PLP? :posx :c2 [DONNE "casex 1][SI PLP? :posx :c3 [DONNE "casex 2][SI PLP? :posx :c4 [DONNE "casex 3][DONNE "casex -1]]]]
SI PLP? :posy :l4 [DONNE "casey -1][SI PLP? :posy :l3 [DONNE "casey 3][SI PLP? :posy :l2 [DONNE "casey 2][SI PLP? :posy :l1 [DONNE "casey 1][DONNE "casey -1]]]]

RENDS LISTE :casex :casey
FIN

POUR DRAWRING

DONNE "bestcell GETBESTCELL

SI EGAL? 0 :bestcell [STOP]

DONNE "i 1
DONNE "newgrid []
REPETE 9 [SI EGAL? :i :bestcell [DONNE "newgrid MD 2 :newgrid][DONNE "newgrid MD ITEM :i :grid :newgrid] DONNE "i SOMME :i 1]
DONNE "grid :newgrid

DONNE "line SOMME QUOT DIFF :bestcell 1 3 1
DONNE "col SOMME RESTE DIFF :bestcell 1 3 1
DONNE "lpos LISTE :col :line

DISPRING SOMME :c1 PROD DIV SOMME PROD DIFF ITEM 1 :lpos 1 2 1 2 :cs DIFF :l1 PROD DIV SOMME PROD DIFF ITEM 2 :lpos 1 2 1 2 :ls 9
FIN

POUR DISPRING :x :y :col

RECYCLE

CT
FCC :col

DONNE "deltat 1
DONNE "nbstep DIV 360 :deltat

DONNE "ray 30
DONNE "t 0
REPETE :nbstep [POINT LISTE SOMME :x PROD :ray COS :t SOMME :y PROD :ray SIN :t DONNE "t SOMME :t :deltat]

DONNE "ray 29
DONNE "t 0
REPETE :nbstep [POINT LISTE SOMME :x PROD :ray COS :t SOMME :y PROD :ray SIN :t DONNE "t SOMME :t :deltat]

DONNE "ray 28
DONNE "t 0
REPETE :nbstep [POINT LISTE SOMME :x PROD :ray COS :t SOMME :y PROD :ray SIN :t DONNE "t SOMME :t :deltat]

DONNE "ray 27
DONNE "t 0
REPETE :nbstep [POINT LISTE SOMME :x PROD :ray COS :t SOMME :y PROD :ray SIN :t DONNE "t SOMME :t :deltat]

FCC 15
MT
FIN

POUR GETBESTCELL

SI ET EGAL? 2 ITEM 1 :grid EGAL? 2 ITEM 2 :grid [SI EGAL? -1 ITEM 3 :grid [RENDS 3]]
SI ET EGAL? 2 ITEM 2 :grid EGAL? 2 ITEM 3 :grid [SI EGAL? -1 ITEM 1 :grid [RENDS 1]]
SI ET EGAL? 2 ITEM 1 :grid EGAL? 2 ITEM 3 :grid [SI EGAL? -1 ITEM 2 :grid [RENDS 2]]
SI ET EGAL? 2 ITEM 4 :grid EGAL? 2 ITEM 5 :grid [SI EGAL? -1 ITEM 6 :grid [RENDS 6]]
SI ET EGAL? 2 ITEM 5 :grid EGAL? 2 ITEM 6 :grid [SI EGAL? -1 ITEM 4 :grid [RENDS 4]]
SI ET EGAL? 2 ITEM 4 :grid EGAL? 2 ITEM 6 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]
SI ET EGAL? 2 ITEM 7 :grid EGAL? 2 ITEM 8 :grid [SI EGAL? -1 ITEM 9 :grid [RENDS 9]]
SI ET EGAL? 2 ITEM 8 :grid EGAL? 2 ITEM 9 :grid [SI EGAL? -1 ITEM 7 :grid [RENDS 7]]
SI ET EGAL? 2 ITEM 7 :grid EGAL? 2 ITEM 9 :grid [SI EGAL? -1 ITEM 8 :grid [RENDS 8]]

SI ET EGAL? 2 ITEM 1 :grid EGAL? 2 ITEM 4 :grid [SI EGAL? -1 ITEM 7 :grid [RENDS 7]]
SI ET EGAL? 2 ITEM 4 :grid EGAL? 2 ITEM 7 :grid [SI EGAL? -1 ITEM 1 :grid [RENDS 1]]
SI ET EGAL? 2 ITEM 1 :grid EGAL? 2 ITEM 7 :grid [SI EGAL? -1 ITEM 4 :grid [RENDS 4]]
SI ET EGAL? 2 ITEM 2 :grid EGAL? 2 ITEM 5 :grid [SI EGAL? -1 ITEM 8 :grid [RENDS 8]]
SI ET EGAL? 2 ITEM 5 :grid EGAL? 2 ITEM 8 :grid [SI EGAL? -1 ITEM 2 :grid [RENDS 2]]
SI ET EGAL? 2 ITEM 2 :grid EGAL? 2 ITEM 8 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]
SI ET EGAL? 2 ITEM 3 :grid EGAL? 2 ITEM 6 :grid [SI EGAL? -1 ITEM 9 :grid [RENDS 9]]
SI ET EGAL? 2 ITEM 6 :grid EGAL? 2 ITEM 9 :grid [SI EGAL? -1 ITEM 3 :grid [RENDS 3]]
SI ET EGAL? 2 ITEM 3 :grid EGAL? 2 ITEM 9 :grid [SI EGAL? -1 ITEM 6 :grid [RENDS 6]]

SI ET EGAL? 2 ITEM 1 :grid EGAL? 2 ITEM 5 :grid [SI EGAL? -1 ITEM 9 :grid [RENDS 9]]
SI ET EGAL? 2 ITEM 5 :grid EGAL? 2 ITEM 9 :grid [SI EGAL? -1 ITEM 1 :grid [RENDS 1]]
SI ET EGAL? 2 ITEM 1 :grid EGAL? 2 ITEM 9 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]
SI ET EGAL? 2 ITEM 3 :grid EGAL? 2 ITEM 5 :grid [SI EGAL? -1 ITEM 7 :grid [RENDS 7]]
SI ET EGAL? 2 ITEM 7 :grid EGAL? 2 ITEM 5 :grid [SI EGAL? -1 ITEM 3 :grid [RENDS 3]]
SI ET EGAL? 2 ITEM 3 :grid EGAL? 2 ITEM 7 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]

SI ET EGAL? 1 ITEM 1 :grid EGAL? 1 ITEM 2 :grid [SI EGAL? -1 ITEM 3 :grid [RENDS 3]]
SI ET EGAL? 1 ITEM 2 :grid EGAL? 1 ITEM 3 :grid [SI EGAL? -1 ITEM 1 :grid [RENDS 1]]
SI ET EGAL? 1 ITEM 1 :grid EGAL? 1 ITEM 3 :grid [SI EGAL? -1 ITEM 2 :grid [RENDS 2]]
SI ET EGAL? 1 ITEM 4 :grid EGAL? 1 ITEM 5 :grid [SI EGAL? -1 ITEM 6 :grid [RENDS 6]]
SI ET EGAL? 1 ITEM 5 :grid EGAL? 1 ITEM 6 :grid [SI EGAL? -1 ITEM 4 :grid [RENDS 4]]
SI ET EGAL? 1 ITEM 4 :grid EGAL? 1 ITEM 6 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]
SI ET EGAL? 1 ITEM 7 :grid EGAL? 1 ITEM 8 :grid [SI EGAL? -1 ITEM 9 :grid [RENDS 9]]
SI ET EGAL? 1 ITEM 8 :grid EGAL? 1 ITEM 9 :grid [SI EGAL? -1 ITEM 7 :grid [RENDS 7]]
SI ET EGAL? 1 ITEM 7 :grid EGAL? 1 ITEM 9 :grid [SI EGAL? -1 ITEM 8 :grid [RENDS 8]]

SI ET EGAL? 1 ITEM 1 :grid EGAL? 1 ITEM 4 :grid [SI EGAL? -1 ITEM 7 :grid [RENDS 7]]
SI ET EGAL? 1 ITEM 4 :grid EGAL? 1 ITEM 7 :grid [SI EGAL? -1 ITEM 1 :grid [RENDS 1]]
SI ET EGAL? 1 ITEM 1 :grid EGAL? 1 ITEM 7 :grid [SI EGAL? -1 ITEM 4 :grid [RENDS 4]]
SI ET EGAL? 1 ITEM 2 :grid EGAL? 1 ITEM 5 :grid [SI EGAL? -1 ITEM 8 :grid [RENDS 8]]
SI ET EGAL? 1 ITEM 5 :grid EGAL? 1 ITEM 8 :grid [SI EGAL? -1 ITEM 2 :grid [RENDS 2]]
SI ET EGAL? 1 ITEM 2 :grid EGAL? 1 ITEM 8 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]
SI ET EGAL? 1 ITEM 3 :grid EGAL? 1 ITEM 6 :grid [SI EGAL? -1 ITEM 9 :grid [RENDS 9]]
SI ET EGAL? 1 ITEM 6 :grid EGAL? 1 ITEM 9 :grid [SI EGAL? -1 ITEM 3 :grid [RENDS 3]]
SI ET EGAL? 1 ITEM 3 :grid EGAL? 1 ITEM 9 :grid [SI EGAL? -1 ITEM 6 :grid [RENDS 6]]

SI ET EGAL? 1 ITEM 1 :grid EGAL? 1 ITEM 5 :grid [SI EGAL? -1 ITEM 9 :grid [RENDS 9]]
SI ET EGAL? 1 ITEM 5 :grid EGAL? 1 ITEM 9 :grid [SI EGAL? -1 ITEM 1 :grid [RENDS 1]]
SI ET EGAL? 1 ITEM 1 :grid EGAL? 1 ITEM 9 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]
SI ET EGAL? 1 ITEM 3 :grid EGAL? 1 ITEM 5 :grid [SI EGAL? -1 ITEM 7 :grid [RENDS 7]]
SI ET EGAL? 1 ITEM 7 :grid EGAL? 1 ITEM 5 :grid [SI EGAL? -1 ITEM 3 :grid [RENDS 3]]
SI ET EGAL? 1 ITEM 3 :grid EGAL? 1 ITEM 7 :grid [SI EGAL? -1 ITEM 5 :grid [RENDS 5]]

;SI EGAL? -1 ITEM 5 :grid [RENDS 5]

DONNE "h SOMME HASARD 9 1
SI EGAL? -1 ITEM :h :grid [RENDS :h][DONNE "i SOMME :h 1 REPETE DIFF 9 :h [SI EGAL? -1 ITEM :i :grid [RENDS :i][] DONNE "i SOMME :i 1] DONNE "i DIFF :h 1 REPETE DIFF :h 1 [SI EGAL? -1 ITEM :i :grid [RENDS :i][] DONNE "i DIFF :i 1]]

RENDS 0
FIN

POUR DRAWGRID
RECYCLE
CT
FCC 14
DONNE "i :l1
REPETE DIFF :l1 :l4 [POINT LISTE :c1 :i DONNE "i DIFF :i 1]
DONNE "i :l1
REPETE DIFF :l1 :l4 [POINT LISTE :c2 :i DONNE "i DIFF :i 1]
DONNE "i :l1
REPETE DIFF :l1 :l4 [POINT LISTE :c3 :i DONNE "i DIFF :i 1]
DONNE "i :l1
REPETE DIFF :l1 :l4 [POINT LISTE :c4 :i DONNE "i DIFF :i 1]

DONNE "i :c1
REPETE DIFF :c4 :c1 [POINT LISTE :i :l1 DONNE "i SOMME :i 1]
DONNE "i :c1
REPETE DIFF :c4 :c1 [POINT LISTE :i :l2 DONNE "i SOMME :i 1]
DONNE "i :c1
REPETE DIFF :c4 :c1 [POINT LISTE :i :l3 DONNE "i SOMME :i 1]
DONNE "i :c1
REPETE DIFF :c4 :c1 [POINT LISTE :i :l4 DONNE "i SOMME :i 1]

FCC 15
MT
RECYCLE
FIN

POUR DRAWCROSS :x :y :col
DONNE "savepos POS
DONNE "savecap CAP

FCC :col
LC
FPOS LISTE :x :y
FCAP 0
BC

TG 45
AV :patternsize
REPETE 5 [TD 90 AV 0.5 TD 90 AV PROD 2 :patternsize TG 90 AV 0.5 TG 90 AV PROD 2 :patternsize ATTENDS 1]
RE :patternsize

TD 90
AV :patternsize
REPETE 5 [TD 90 AV 0.5 TD 90 AV PROD 2 :patternsize TG 90 AV 0.5 TG 90 AV PROD 2 :patternsize ATTENDS 1]
RE :patternsize

LC
FPOS :savepos
FCAP :savecap
BC
FCC 15
FIN

POUR DRAWROBOT :col
CT
SI EGAL? 0 :col [FCC 0][FCC :col]
DONNE "i 200
REPETE 100 [POINT LISTE :i 100 DONNE "i SOMME :i 1]
DONNE "i 200
REPETE 100 [POINT LISTE :i 170 DONNE "i SOMME :i 1]
DONNE "i 100
REPETE 70 [POINT LISTE 200 :i DONNE "i SOMME :i 1]
DONNE "i 130
REPETE 10 [POINT LISTE 250 :i DONNE "i SOMME :i 1]
DONNE "i 100
REPETE 70 [POINT LISTE 300 :i DONNE "i SOMME :i 1]

SI EGAL? 0 :col [FCC 0][FCC 4]
DONNE "t 0
REPETE 360 [POINT LISTE SOMME 220 PROD 10 COS :t SOMME 150 PROD 10 SIN :t DONNE "t SOMME :t 1]
DONNE "t 0
REPETE 360 [POINT LISTE SOMME 280 PROD 10 COS :t SOMME 150 PROD 10 SIN :t DONNE "t SOMME :t 1]

SI EGAL? 0 :col [FCC 0][FCC 6]
DONNE "i 230
REPETE 40 [POINT LISTE :i 115 DONNE "i SOMME :i 1]
DONNE "i 230
REPETE 40 [POINT LISTE :i 120 DONNE "i SOMME :i 1]
DONNE "i 115
REPETE 5 [POINT LISTE 230 :i DONNE "i SOMME :i 1]
DONNE "i 115
REPETE 5 [POINT LISTE 270 :i DONNE "i SOMME :i 1]

SI NEGAL? 0 :col [DONNE "t 0 REPETE 72 [DONNE "x SOMME 220 PROD 3 COS :t DONNE "y SOMME 150 PROD 3 SIN :t DONNE "y2 SOMME 150 PROD -3 SIN :t FCC 14 POINT LISTE :x :y FCC 14 POINT LISTE SOMME 60 :x :y2 ATTENDS 1 FCC 0 POINT LISTE :x :y POINT LISTE SOMME 60 :x :y2 DONNE "t SOMME :t 10]]

SI EGAL? 0 :col [FCC 0][FCC 14]
POINT [220 148]
POINT [220 149]
POINT [221 148]
POINT [221 149]

POINT [280 148]
POINT [280 149]
POINT [279 148]
POINT [279 149]

FCC 15
MT
ATTENDS 500
FIN

POUR CHKWIN :j
SI ET ET EGAL? :j ITEM 1 :grid EGAL? :j ITEM 2 :grid EGAL? :j ITEM 3 :grid [RENDS [1 0]]
SI ET ET EGAL? :j ITEM 4 :grid EGAL? :j ITEM 5 :grid EGAL? :j ITEM 6 :grid [RENDS [2 0]]
SI ET ET EGAL? :j ITEM 7 :grid EGAL? :j ITEM 8 :grid EGAL? :j ITEM 9 :grid [RENDS [3 0]]

SI ET ET EGAL? :j ITEM 1 :grid EGAL? :j ITEM 4 :grid EGAL? :j ITEM 7 :grid [RENDS [0 1]]
SI ET ET EGAL? :j ITEM 2 :grid EGAL? :j ITEM 5 :grid EGAL? :j ITEM 8 :grid [RENDS [0 2]]
SI ET ET EGAL? :j ITEM 3 :grid EGAL? :j ITEM 6 :grid EGAL? :j ITEM 9 :grid [RENDS [0 3]]

SI ET ET EGAL? :j ITEM 1 :grid EGAL? :j ITEM 5 :grid EGAL? :j ITEM 9 :grid [RENDS [-1 -1]]
SI ET ET EGAL? :j ITEM 3 :grid EGAL? :j ITEM 5 :grid EGAL? :j ITEM 7 :grid [RENDS [-2 -2]]

RENDS [0 0]
FIN

POUR WIN
DUREE 10
JOUE "SO
JOUE "MI
DUREE 50
JOUE "LA
ECRIS [Bravo, tu as gagne!]
DONNE "fin 2
ECRISGRAPH [Bravo, tu as gagne!] 11 [21 0] [2 2]
FCC 15
SAUVEIMAGE "LogoXo
FIN

POUR EXAEQUO
DUREE 10
JOUE "LA
JOUE "SI
ECRIS [Ex aequo!]
DONNE "fin 3
ECRISGRAPH [Ex aequo!] 10 [31 0] [2 2]
FCC 15
SAUVEIMAGE "LogoXo
FIN

POUR LOSE
ECRIS [Tu as perdu!]
DUREE 80
JOUE "DO
DONNE "fin 1
REPETE 5 [CT ATTENDS 5000 MT ATTENDS 5000]

ECRISGRAPH [Tu as perdu!] 13 [29 0] [2 2]
FCC 15
SAUVEIMAGE "LogoXo
FIN

POUR ECRISGRAPH :texte :couleur :position :taille
SORTIE 6
FCURS :position
FTCAR :taille
FCT :couleur
TAPE :texte
FCT 15
SORTIE 1
FIN

 © Olivier Schmidt-Chevalier - oct., nov. 2003

 RETOUR