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

Attachment: hanoi.pd
Description: Binary data

Attachment: hanoi-help.pd
Description: Binary data



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

Reply via email to