Skip to main content

Tower of Hanoi (using k peg)

Project description

Tower of Hanoi (using k peg)

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

k_peg_hanoi-0.2.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: k_peg_hanoi-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for k_peg_hanoi-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c82709a713c956fa49ec33c4272cbc486311ba3f4181cd2567293b7e4acdfd36
MD5 bfac1ca538237c10f9476b2473228b61
BLAKE2b-256 b0134b5b3afcbf5297502e5693ac08904dcaa1f86170e0368d3017bc934c1d6e

See more details on using hashes here.

Supported by

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