This may or may not help, but here’s an example of spinning 4 disks looking for a match at the four green compare positions. Each time this is run, the 4 disks will have different sprite positions. The disks are not spinning when the program starts, tap the screen and disk 4 will spin at full speed. You can open the print window and move the slider to slow it down. The disks will stop when the sprite pairs match in the green rectangles. Tap the screen to continue again. Sometimes there won’t be any match’s, sometimes 1, sometimes a few. The number in the center shows the rotation number for disks 1 thru 4. The numbers will go from 1111 to 8888. It will stop at 8888. To solve @Bri_G challenge, no graphics need to be used. My program to solve his challenge uses no graphics and just prints out the 4 digit rotation number. This program only uses one sided disks and one image to compare, his uses 2 sided disks and uses 2 pictures to compare.
displayMode(FULLSCREEN)
function setup()
parameter.integer("delay",0,60,0)
pic={"Planet Cute:Character Princess Girl","Planet Cute:Character Boy","Planet Cute:Character Cat Girl","Planet Cute:Character Horn Girl","Planet Cute:Character Pink Girl","Planet Cute:Star","Planet Cute:Heart","Planet Cute:Key" }
fill(255)
disk={}
r={}
for z=1,4 do
u={1,2,3,4,5,6,7,8}
disk[z]={}
r[z]={}
for y=1,8 do
h=math.random(#u)
disk[z][y]=u[h]
table.remove(u,h)
r[z][y]=disk[z][y]
end
end
p={1,1,1,1}
cnt=0
str=""
found=true
end
function draw()
background(224, 198, 134, 255)
fill(255)
ellipse(WIDTH/2-200,HEIGHT-220,370)
ellipse(WIDTH/2+200,HEIGHT-220,370)
ellipse(WIDTH/2-200,HEIGHT-600,370)
ellipse(WIDTH/2+200,HEIGHT-600,370)
fill(0)
ellipse(WIDTH/2-200,HEIGHT-220,200)
ellipse(WIDTH/2+200,HEIGHT-220,200)
ellipse(WIDTH/2-200,HEIGHT-600,200)
ellipse(WIDTH/2+200,HEIGHT-600,200)
fill(0, 255, 93, 255)
rect(WIDTH/2-100,HEIGHT-260,200,80)
rect(WIDTH/2-100,HEIGHT-640,200,80)
rect(WIDTH/2-240,HEIGHT-500,80,180)
rect(WIDTH/2+160,HEIGHT-500,80,180)
show(1,WIDTH/2-200,HEIGHT-70)
show(2,WIDTH/2+200,HEIGHT-70)
show(3,WIDTH/2-200,HEIGHT-450)
show(4,WIDTH/2+200,HEIGHT-450)
fill(255,0,0)
text("Disk 1",WIDTH/2-200,HEIGHT-220)
text("Disk 2",WIDTH/2+200,HEIGHT-220)
text("Disk 3",WIDTH/2-200,HEIGHT-600)
text("Disk 4",WIDTH/2+200,HEIGHT-600)
cnt=cnt+1
if cnt>delay then
add()
cnt=0
end
if done then
str="search complete, press restart icon"
else
str=string.format("%2d %2d %2d %2d",p[1],p[2],p[3],p[4])
end
text(str,WIDTH/2,HEIGHT-400)
text("tap screen to pause or continue",WIDTH/2,50)
end
function touched(t)
if t.state==BEGAN then
found=not found
end
end
function show(d,x,y)
sprite(pic[r[d][5]],x,y,80)
sprite(pic[r[d][6]],x-100,y-50,80)
sprite(pic[r[d][4]],x+100,y-50,80)
sprite(pic[r[d][7]],x-140,y-140,80)
sprite(pic[r[d][3]],x+140,y-140,80)
sprite(pic[r[d][8]],x-100,y-230,80)
sprite(pic[r[d][2]],x+100,y-230,80)
sprite(pic[r[d][1]],x,y-280,80)
end
function add()
if found or done then
return
end
for a=4,1,-1 do
p[a]=p[a]+1
if p[a]>8 then
if a==1 then
done=true
end
p[a]=1
else
break
end
end
for x=1,4 do
s=p[x]
for y=1,8 do
r[x][y]=disk[x][s]
s=s+1
if s>8 then
s=1
end
end
end
if r[1][1]==r[3][5] and r[1][3]==r[2][7] and r[2][1]==r[4][5] and r[4][7]==r[3][3] then
found=true
end
end