Powers of Hanoi

A Novel Variant of the classic Towers of Hanoi puzzle, by Luthwyhn.

You begin each of the three levels with a set of already-built towers and empty spaces. Your goal is to build a new tower on the right-most space with a total value equal to the red number below it, in as few moves as possible. Like in Towers, you do this by moving the top number from any tower into any valid new position, one at a time. HOWEVER! Unlike in the original Towers puzzle, where a disk can be placed atop any other disk larger than itself, in Powers you may only place a number X on top of another number Y if the binary representation of Y contains 1s in all the places the binary representation of X has 1s.

For example: the number 2 (0010) can be placed atop 3 (0011) or 7 (0111), but not atop 4 (0100).

This TweetTweetJam implementation has 3 static levels. Some may have multiple valid solutions! Your total number of moves is tracked at the top of the screen, try to solve all three puzzles in as few moves as possible! The game is over when you have a tower of value 123 on the rightmost space on level 3, but there is no screen confirming this due to space limits.

Have fun! Thanks for playing!

Controls:

  Left/Right: Change tower selection

  Z/Circle Button:  Select/Move Selection


Pico8 Source Code (total length: 560 characters!)--


t={{7,5,4},{3,2,1},{6},{8},{}}r={{{13,5,1},{15,11,3},{14,12,4},{},{}},{{54,22,20,16},{45,44,36,4},{63,47,15,12},{},{}}}g={9,24,123}s=1c=7m=0l=0n=1v=btnp::q::flip()
if(v(1))s+=1
if(v(0))s-=1
s=mid(1,s,5)
if(not v(4))goto k
if(l==0or#t[l]==0)l=s goto k
if(l==s)l=0 goto k
a=t[l][#t[l]]
if(#t[s]==0or(a&t[s][#t[s]]==a))add(t[s],a)del(t[l],a)l=0m+=1
::k::cls(1)for i=1,5do p=0c=6if(i==l)c=2
if(i==s)c=3
x=8+(i-1)*18
?'---',x,64,c
for j=1,#t[i]do y=64-j*8p+=t[i][j]
?t[i][j],x,y,c
end
?g[n],80,80,8
?p,x,72,14
?"m:"..m,9,9,6
end if(n<3and g[n]==p)t=r[n]n+=1
goto q

StatusReleased
PlatformsHTML5
Authorluthwyhn
GenrePuzzle
Made withPICO-8
TagsMath, PICO-8

Download

Download NowName your own price

Click download now to get access to the following files:

power.html 42 kB
power.js 1.5 MB
power.p8 17 kB
power.p8.png 2.9 kB

Comments

Log in with itch.io to leave a comment.

(+1)

That last puzzle was quite tricky! I got M:24 by planning out my moves in advance, not sure if anyone can improve that further. Great puzzle concept!

(+1)

Yay! Yes, I think 24 was my best score as well. Would love to see if there're any shorter routes. Thanks for playing :D