Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Deep Toaster on November 16, 2010, 07:58:59 pm

Title: The Towers of H'annoy
Post by: Deep Toaster on November 16, 2010, 07:58:59 pm
Yet another tiny project I'm working on: This is basically the Towers of Hanoi in BASIC, except that everything's reversed: larger plates go on top of smaller ones. That's basically all it is right now, but I'm going to add a timer that makes the plates "collapse" when you wait too long before moving something (because putting bigger stuff on smaller stuff is unstable :D).
Title: Re: The Towers of H'annoy
Post by: shmibs on November 16, 2010, 08:11:14 pm
that is actually a wonderful idea! i'm liking all the work, deep thought!
Title: Re: The Towers of H'annoy
Post by: ztrumpet on November 16, 2010, 08:15:34 pm
Nice job!  I really like it, though bigger on smaller is a little confusing.  I need to get used to it. :)
Wonderful program, though! ;D
Title: Re: The Towers of H'annoy
Post by: DJ Omnimaga on November 17, 2010, 03:36:39 am
That seems nice. I gave up after 15 minutes, though, because I could no longer figure out how to solve the puzzle anymore  X.x
Title: Re: The Towers of H'annoy
Post by: Builderboy on November 17, 2010, 03:52:22 am
Lol im right there with you Dj, i suck at the towers of H'annoy.  Awesome program though ^^
Title: Re: The Towers of H'annoy
Post by: jnesselr on November 17, 2010, 06:53:15 am
I know how to solve it one way, but how about upside down? Interesting indeed.  I'll try it later.
Title: Re: The Towers of H'annoy
Post by: ztrumpet on November 17, 2010, 06:58:58 am
I was so inspired by this that I made my own version (with 5 blocks) for my Homescreen Game Pack. ;D
Title: Re: The Towers of H'annoy
Post by: Deep Toaster on November 17, 2010, 10:34:32 am
Quote from: DJ Omnimaga
That seems nice. I gave up after 15 minutes, though, because I could no longer figure out how to solve the puzzle anymore  X.x

Whoops, I probably shouldn't have posted it with 9 blocks ;D

To make it easier, just go into the program and change the 9 in 9→L to whatever number of blocks you want. If you've never played the Towers of Hanoi, I'd suggest 3.

Oh, and forgot to tell you: I haven't actually added win detection yet. Just know that when you move all the blocks to the right side, you win :)

Quote from: ztrumpet
I was so inspired by this that I made my own version (with 5 blocks) for my Homescreen Game Pack. ;D

Great, I hope it's the regular Towers of Hanoi, though, instead of the reverse? ;)
Title: Re: The Towers of H'annoy
Post by: DJ Omnimaga on November 17, 2010, 02:54:06 pm
Ah I see. Yeah that seemed like an hard level lol. In my attempt, the left pile ended up with 4 blocks at the very best.
Title: Re: The Towers of H'annoy
Post by: ztrumpet on November 17, 2010, 04:27:31 pm
Oh, and forgot to tell you: I haven't actually added win detection yet. Just know that when you move all the blocks to the right side, you win :)
If you're using a matrix, you can use the detection that I use in HGP if you like. :)
You could also do it with pxl-Test() ;D
Title: Re: The Towers of H'annoy
Post by: Deep Toaster on November 17, 2010, 06:28:41 pm
Oh, and forgot to tell you: I haven't actually added win detection yet. Just know that when you move all the blocks to the right side, you win :)
If you're using a matrix, you can use the detection that I use in HGP if you like. :)
You could also do it with pxl-Test() ;D

Nope, three lists. It should be pretty easy to detect (just an If not(sum(not(L3 statement).

Just wondering, though, how do you do it in the game pack?
Title: Re: The Towers of H'annoy
Post by: ztrumpet on November 17, 2010, 07:10:58 pm
I start with [A] looking like this:
1,0,0
2,0,0
3,0,0
4,0,0
5,0,0
0,0,0
And then I check like this:
1
For(D,1,5
Ans(D=max([A](D,2),[A](D,3
End
If this is still 1, then you win!

Edit:
Nope, three lists. It should be pretty easy to detect (just an If not(sum(not(L3 statement).
That could be If prod(L3,1,dim(L3
Title: Re: The Towers of H'annoy
Post by: Deep Toaster on November 17, 2010, 11:12:44 pm
I start with [A] looking like this:
1,0,0
2,0,0
3,0,0
4,0,0
5,0,0
0,0,0
And then I check like this:
1
For(D,1,5
Ans(D=max([A](D,2),[A](D,3
End
If this is still 1, then you win!

Nice, I really should use fewer vars. All my programs claim they're "conveniently packaged in a single program," but when they run they use up a lot more x.x

Edit:
Nope, three lists. It should be pretty easy to detect (just an If not(sum(not(L3 statement).
That could be If prod(L3,1,dim(L3

Oh, right, didn't think of that. It's been a long time since I've tried using another command...

Wouldn't If prod(L3 work too?
Title: Re: The Towers of H'annoy
Post by: ztrumpet on November 18, 2010, 01:05:08 pm
Edit:
Nope, three lists. It should be pretty easy to detect (just an If not(sum(not(L3 statement).
That could be If prod(L3,1,dim(L3

Oh, right, didn't think of that. It's been a long time since I've tried using another command...

Wouldn't If prod(L3 work too?
Probably.  I forget if it can just have one argument.  I think it can. :P