Perl 6
Tower of Hanoi: Revision 7

Description

Invented by the French mathematician Édouard Lucas in 1883, this is a mathematical game/puzzle about moving a set of disks between a set of pegs, limited by the following rules :

  • Only one disk may be moved at a time.
  • Each move consists of taking the upper disk from one of the pegs and sliding it onto another peg, on top of the other disks that may already be present on that peg.
  • No disk may be placed on top of a smaller disk.

Solutions

http://svn.pugscode.org/pugs/examples/algorithms/hanoi.pl

Status with current release of perl 6 / parrot

  • Parrot 5.1 December 2007 : compiler errors - subs and argv not implemented
  • Parrot SVN Revision 24336 December 2007 : works without // and argv syntax (http://nopaste.snit.ch:8001/11939)
  • Pugs SVN revision 18224 : works as is

Benchmarks

1000 iterations with 6 disks - skip output (or comment on output to file, etc)

  • Pugs revision 18224 :

Comparisons against Perl 5, etc

References


Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: