[PD] Tower of Hanoi

2007-02-28 Thread Steffen

Hey list,

I've toyed with an implementation of a solution to the Tower of Hanoi  
problem in Pd. It ended up being too simple once i skipped trying to  
use the recursive algorithm that normally is used to solve the  
problem. Instead i've used an iterative algorithm that uses a binary  
representation of each move, and from that the disk number being  
moved, from where it's moved and where to, is fairly simply  
calculations using the bitwise operators that ships with Pd ( - which  
I thought i was gonna implement that first, but no).


See for example the wikipedia entry on the topic for more info.

Attached is the patch, made as an abstraction, and a help file that  
demonstrate it.


Any comment is very welcome!

Best, Steffen



hanoi.pd
Description: Binary data


hanoi-help.pd
Description: Binary data



___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Tower of Hanoi

2007-02-28 Thread hard off
will have a look now, but wikipedia says it takes 561 billion years to
get a solution.

you may never see me again!

___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list


Re: [PD] Tower of Hanoi

2007-02-28 Thread Steffen

On 28/02/2007, at 13.32, hard off wrote:

 will have a look now, but wikipedia says it takes 561 billion years to
 get a solution.

 you may never see me again!

Yes, if you set it up with 64 disks and 1 sec. delay between each  
move...

Hope you come back.

Best, Steffen

___
PD-list@iem.at mailing list
UNSUBSCRIBE and account-management - 
http://lists.puredata.info/listinfo/pd-list