Hanoi Painter

Who among us hasn’t wanted to play the Towers of Hanoi on the Github commit-history graph?

Graph

Github :: Twitter :: Mastodon

I made some changes to my Hanoi Jane gem:

I then built Gitpaint, which allows you paint whatever 52*7, 5-grayscale data you want onto the Github graph

And then I brought it all together with this, orchestrated by Rake. The default Rake task will:

Deserialise the saved Towers

Or spawn a new set if a save-file can’t be found

Render the output to Github

Which means:

Sleep for 10 seconds

To allow Github time to refresh

Take a screenshot

There’s some heavily cargo-culted Node which takes the screenshots using Chromium

Broadcast the screenshot

To Twitter and Mastodon, using the Ternary values from Hanoi Jane as the text

Move and serialise the towers

Ready for the next run

Configuration

This all requires quite a lot of configuration, as you might expect, which should go in config/config.yaml:

Gitpaint

Needs:

Hanoi Jane

Needs:

Twitter

Needs:

Mastodon

Needs:

(copy config/config-example.yaml to config/config.yaml and fill in as required)

Timescale

It takes 2187 moves to solve the 7-disc Towers of Hanoi (3**7). EMF Camp 2020 is about 16600 hours away from now, 2018-10-06 (presuming it happens around the same time as this year’s), and I want this to finish right in the middle of EMF. 16600 / 2187 is about 7.5, so I’m cronning this for three times a day and I’ll review that schedule when the actual dates are announced