Skip to main content

Tower of Hanoi (using k peg)

Project description

Tower of Hanoi (using k peg)

Install

pip install k-peg-hanoi

Usage (hanoi {disk#} {rod#})

See hanoi --help

$ hanoi 3 3
  =               
 ===              
=====             
0----------------

 ===              
=====         =   
1----------------

=====  ===    =   
2----------------

        =         
=====  ===        
3----------------

        =         
       ===  ===== 
4----------------

  =    ===  ===== 
5----------------

             ===  
  =         ===== 
6----------------

              =   
             ===  
            ===== 
7----------------
$ hanoi 3 4
  =                     
 ===                    
=====                   
0----------------------

 ===                    
=====   =               
1----------------------

=====   =    ===        
2----------------------

        =    ===  ===== 
3----------------------

                   ===  
        =         ===== 
4----------------------

                    =   
                   ===  
                  ===== 
5----------------------
$ hanoi 4 4 --text
#1 disk 1 from 0 to 1
#2 disk 2 from 0 to 3
#3 disk 3 from 0 to 2
#4 disk 2 from 3 to 2
#5 disk 4 from 0 to 3
#6 disk 2 from 2 to 0
#7 disk 3 from 2 to 3
#8 disk 2 from 0 to 3
#9 disk 1 from 1 to 3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

k_peg_hanoi-0.2.5-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file k_peg_hanoi-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: k_peg_hanoi-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for k_peg_hanoi-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 11d6e8f6fbf55ee810274e45fc5b74b667fe3783b15a723b3a137dd74d414faa
MD5 315d82b15134166923cac48c1d5084b6
BLAKE2b-256 485af5088c78dc56c7de4cfb3720c8ade7dbb1fc96fc6249f21c7ca0ccc5424f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page