Here’s my brute force code that search’s only the disk orientation for
12
34.
The number of lines of code here varies depending on the device and orientation, but there are 32 numbered lines in the editor.
This prints out
15 xl 5 ft 9 xf 10 pt
The numbers 15, 5, 9, 10 is the front or back of the disk. 1 to 8 is front, 9 to 16 is back. So it’s back, front, back, back.
The xl, ft, xf, pt is the animal pairs at the 6 o’clock position of the disks.
(xl for fox,lion) (ft for frog,tiger) (xf for fox,frog) (pt for panda,tiger).
See the link above SolutionBMsm.png that@Bri-G posted of the solution
I’m still working on a direct solution to eliminate dead end searches.
I’m not posting this with the ~~~ (3 tildes) at the start and end. If I do, it doesn’t display the full table. You can format it if you want, but it runs OK as posted.
function setup()
tab={{{“lt”,“tl”},{“pf”,“fp”},{“up”,“pu”},{“lr”,“rl”},{“px”,“xp”},{“xl”,“lx”},{“xt”,“tx”},{“pu”,“up”},{“pr”,“rp”},{“rx”,“xr”},{“pf”,“fp”},{“ft”,“tf”},{“tp”,“pt”},{“rx”,“xr”},{“xl”,“lx”},{“rl”,“lr”},},{{“lf”,“fl”},{“fp”,“pf”},{“rp”,“pr”},{“pt”,“tp”},{“ft”,“tf”},{“xp”,“pp px”},{“rl”,“lr”},{“fx”,“xf”},{“tr”,“rt”},{“px”,“xp”},{“fx”,“xf”},{“rf”,“fr”},{“xr”,“rx”},{“ft”,“tf”},{“tl”,“lt”},{“tx”,“xt”},},{{“lr”,“rl”},{“pr”,“rp”},{“lf”,“fl”},{“rt”,“tr”},{“lt”,“tl”},{“pu”,“up”},{“fr”,“rf”},{“xu”,“ux”},{“xf”,“fx”},{“rp”,“pr”},{“xu”,“ux”},{“rf”,“fr”},{“lx”,“xl”},{“tr”,“rt”},{“tp”,“pt”},{“xt”,“tx”},},{{“lx”,“xl”},{“tf”,“ft”},{“tx”,“xt”},{“xf”,“fx”},{“tl”,“lt”},{“fl”,“lf”},{“ux”,“xu”},{“fr”,“rf”},{“xr”,“rx”},{“pt”,“tp”},{“rt”,“tr”},{“up”,“pu”},{“xp”,“px”},{“tf”,“ft”},{“fl”,“lf”},{“ux”,“xu”},},}
disk={1,1,1,1} – set starting values for each disk
while not done do – loop thru all disk positions until done
compare()
end
end
function compare() – compare 4 image pairs at the connecting points
if tab[1][rotate(1,0)][1]==tab[3][rotate(3,4)][2] and tab[1][rotate(1,2)][1]==tab[2][rotate(2,6)][2] and tab[2][rotate(2,0)][1]==tab[4][rotate(4,4)][2] and tab[3][rotate(3,2)][1]==tab[4][rotate(4,6)][2] then
print(disk[1],tab[1][disk[1]][1],disk[2],tab[2][disk[2]][1],disk[3],tab[3][disk[3]][1],disk[4],tab[4][disk[4]][1])
end
for z=4,1,-1 do – increment the values in the disk table
disk[z]=disk[z]+1
if disk[z]>16 then
if z==1 then
done=true – if disk[1] >16, we’re done.
end
disk[z]=1
else
break
end
end
end
function rotate(p,a) – move the value in disk[p] thru the table.
temp=disk[p]+a
if disk[p]>8 and temp>16 or disk[p]<9 and temp>8 then
temp=temp-8
end
return temp
end