Skip to main content

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

Metadata

Release files for k-peg-hanoi 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for k-peg-hanoi 0.2.5
File Interpreter ABI Platform
k_peg_hanoi-0.2.5-py3-none-any.whl Python 3 none any Details

Release files / k_peg_hanoi-0.2.5-py3-none-any.whl

Download URL k_peg_hanoi-0.2.5-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11d6e8f6fbf55ee810274e45fc5b74b667fe3783b15a723b3a137dd74d414faa
BLAKE2b-256 checksum
How to use checksums
485af5088c78dc56c7de4cfb3720c8ade7dbb1fc96fc6249f21c7ca0ccc5424f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.2.5 This release

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page