Author Topic: The Towers of H'annoy  (Read 2697 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
The Towers of H'annoy
« 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).

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: The Towers of H'annoy
« Reply #1 on: November 16, 2010, 08:11:14 pm »
that is actually a wonderful idea! i'm liking all the work, deep thought!

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: The Towers of H'annoy
« Reply #2 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

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: The Towers of H'annoy
« Reply #3 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
« Last Edit: November 17, 2010, 03:45:05 am by DJ Omnimaga »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: The Towers of H'annoy
« Reply #4 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 ^^

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: The Towers of H'annoy
« Reply #5 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.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: The Towers of H'annoy
« Reply #6 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

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: The Towers of H'annoy
« Reply #7 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? ;)




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: The Towers of H'annoy
« Reply #8 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.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: The Towers of H'annoy
« Reply #9 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

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: The Towers of H'annoy
« Reply #10 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?
« Last Edit: November 17, 2010, 06:28:53 pm by Deep Thought »




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: The Towers of H'annoy
« Reply #11 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
« Last Edit: November 17, 2010, 07:12:05 pm by ztrumpet »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: The Towers of H'annoy
« Reply #12 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?
« Last Edit: November 17, 2010, 11:13:01 pm by Deep Thought »




Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: The Towers of H'annoy
« Reply #13 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