CA{1}=RED Ca{2}=BLUE CA{3}=GREEN CA{4}=coral CA{5}=LIGHTBLUE
CA{6}=ORANGE CA{7}=10 CA{8}=2 CA{9}=19 CA{10}=28 CA{11}=32
CA{12}=45 CA{13}=3 CA{14}=446 CA{15}=489 CA{16}=0 CA{17}=258
CA{18}=334 CA{19}=312 CA{20}=314 CA{21}=337 CA{22}=325 CA{23}=441
CA{24}=211 CA{25}=17
m=2
while m<=50 [robot 9+m [shape [solid CA{m/2} [circle 38]] ]
robot 10+m [shape [solid CA{m/2} [circle 38]] ]
m=m+2]
i=m - 2
m=2
while m<=50 [robot 9+m+i [shape [solid CA{m/2} [BOX 38 38]] ]
robot 10+m+i [shape [solid CA{m/2} [BOX 38 38]] ]
m=m+2]
robot 11 [shape [circle 40]]
robot 12 [shape [circle 40]]
robot 13 [shape [box 35 35]]
robot 14 [shape [box 35 35]]
robot 15 [shape [size 0.5 [star 5]]]
robot 16 [shape [size 0.5 [star 5]]]
robot 17 [shape [size 0.5 [star 7]]]
robot 18 [shape [size 0.5 [star 7]]]
robot 19 [shape [size 0.5 [starskip 3 7]]]
robot 20 [shape [size 0.5 [starskip 3 7]]]
robot 21 [shape [size 0.5 [starskip 4 8]]]
robot 22 [shape [ size 0.5 [starskip 4 8]]]
robot 23 [shape [size 0.5 [starskip 10 20]]]
robot 24 [shape [size 0.5 [starskip 10 20]]]
robot 25 [shape [size 0.5 [starskip 2 4]]]
robot 26 [shape [ size 0.5 [starskip 2 4]]]
robot 27 [shape [circle 40 box 20 20]]
robot 28 [shape [circle 40 box 20 20]]
robot 29 [shape [circle 40 size 0.5 [star 7 ]]]
robot 30 [shape [circle 40 size 0.5 [star 7]]]
robot 31 [shape [circle 40 size 0.5 [starskip 4 8] ]]
robot 32 [shape [circle 40 size 0.5 [starskip 4 8] ]]
robot 33 [shape [circle 40 size 0.5 [starskip 10 20] ]]
robot 34 [shape [circle 40 size 0.5 [starskip 10 20] ]]
robot 35 [shape [circle 40 circle 30 solid 0 [circle 20] ]]
robot 36 [shape [circle 40 circle 30 solid 0 [circle 20 ] ]]
robot 37 [shape [circle 40 circle 30 box 20 20 ]]
robot 38 [shape [circle 40 circle 30 box 20 20 ]]
robot 39 [shape [circle 40 circle 30 solid 0 [box 20 20] ]]
robot 40 [shape [circle 40 circle 30 solid 0 [box 20 20 ] ]]
robot 41 [shape [circle 40 spin 2 [curver 180 20 gobk 20] ]]
robot 42 [shape [circle 40 spin 2 [curver 180 20 gobk 20 ]]]
robot 43 [shape [circle 40 size 0.5 [ngon 4]]]
robot 44 [shape [circle 40 size 0.5 [ngon 4 ]]]
robot 45 [shape [circle 40 size 0.5 [ngon 3 ]]]
robot 46 [shape [circle 40 size 0.5 [ngon 3 ]]]
for i 1 r [for j 1 c [
x=-c/2*l + l/2 +(j - 1)*l
y=r/2*l - l/2 - (i - 1)*l
call [jt x y box l l]
]]
r=5 c=5//#rows columns c is always even
l=50//Length and width of base square
play_engine
SIZE l/40 [Define_robots]
n=r*c////# robots
//size l/40 [Define_colors]
ROBOT 1 [ON HIDE]
BG White Drawboard
//shuffle
FOR i 1 n [lboard{i}=i] SHUFFLE lboard{1} n
nguesses=0 nclick=0
CLICK
[MXY x1 y1 //found mouse location
//checks if it is legal location and do the rest, otherwise do nothing
IF y1<r/2*l AND -r/2*l<y1 AND x1<c/2*l AND -c/2*l<x1
[
//now it translates it to the 2-d integer array
i=ROUND (-y1/l+r/2+0.501) j=ROUND (x1/l+c/2+0.501)
//translates back to the center of the square
x=-c/2*l+l/2+(j - 1)*l y=r/2*l - l/2 - (i - 1)*l
k=(i - 1)*c+j //finds the index of the linear array
nclick=nclick+1 //updates the click #
ROBOT (10+lboard{k}) [SHOW RGT x y] //activates the robots and brings it to its place
//if it is the first(or odd) click remember the location and hide the previous two robots if they were not guessed
// else [
//if both match check if the game is over
IF nclick MOD 2==1
[IF guessed==0 [ROBOT (10+lboard{k2}) [HIDE] ROBOT (10+lboard{k3}) [HIDE]] k1=k g2=lboard{k}] ELSE [
IF lboard{k}!=0 [g1=lboard{k}
IF g2<g1 [m=g1 g1=g2 g2=m]
IF g2 MOD 2==0 AND g1+1==g2
[guessed=1 nguesses=nguesses+2 lboard{k}=0 lboard{k1}=0 IF nguesses==n [jt 0 0 spiral STOP]]
ELSE [guessed=0 k2=k k3=k1]]
]
]
]
x=30+ rnd 40
y = 360/(2+rnd 4) + 3 - rnd 7
growby 5% 400 [
spin x [
JT 137 139 COLOR Violet [ MT -1 -8]
JT -158 160 COLOR Gold [ MT -2 -8]
JT -184 -162 COLOR Red [ MT -1 -10]
JT 162 -148 COLOR rnd 16 [ MT -3 -10]
]
rt y
]
r=6 c=6 n=r*c l=40
robot 1 [on hide]
//define_colors
define_robots
for i 1 r [for j 1 c [
x=-c/2*l + l/2 +(j - 1)*l
y=r/2*l - l/2 - (i - 1)*l
call [jt x y box l l]
k=(i - 1)*c+j //finds the index of the linear array
robot 10+ k[show rgt x y ]
]]