83
submitted 15 hours ago by christos@lemmy.world to c/linux@lemmy.ml

https://gitlab.com/christosangel/hanoi

Hanoi is a simple terminal version of the known classical game Tower of Hanoi, written in Bash.

During the game, the user can move left and right, pick disks and drop them in other stacks.

The aim is to move all the disks from the ORIGIN pile to the DESTINATION pile, in as little moves as possible

hanoi.png

top 9 comments
sorted by: hot top controversial new old
[-] M33@piefed.world 28 points 14 hours ago

Impressive 🙂

Unsolicited Rust rewrite in 5…4…3…🤭

[-] christos@lemmy.world 2 points 7 hours ago

Rust away!🤭 Actually it sounds reasonable, I guess in Rust 2D arrays are easier to work with than in Bash.

[-] racketlauncher831@lemmy.ml 2 points 13 hours ago

Why are you sharing your program with miniserve?

[-] M33@piefed.world 2 points 7 hours ago

I'm not sure to understand that question ?

[-] christos@lemmy.world 1 points 7 hours ago

I don't understand what you are asking, please elaborate.

[-] 7eter@feddit.org 3 points 13 hours ago

nice - do you know why using h+l is so much faster than the arrow keys?

[-] Marty_TF@lemmy.zip 3 points 13 hours ago* (last edited 13 hours ago)

bcs u dont need to put one hand on the arrow keys and have to use the other hand for the rest of the keyboard or alternatively jump around with ur hands

of course this isnt a huge factor in a little game but vim people are used to it. i was sceptical of vim keybinding at first but then i started using it and dam it is true that it's superior

[-] 7eter@feddit.org 4 points 13 hours ago

Agreed! But I also noticed a significant performance difference (in the time that the game take to update the selected stack). It might be due to my lack in cli-gaming, but I never noticed something like that before.

[-] christos@lemmy.world 1 points 7 hours ago

You noticed correctly, I made the trade off because I wanted to have an extra disk level available (10 instead of 9), but I believe it was not worth it. I updated the script, it is now quite snappier I think, check it out if you wish, and let me know what you think.

Thanks for the feedback.

this post was submitted on 10 Jun 2026
83 points (98.8% liked)

Linux

65668 readers
577 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS