Drath's hideout
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
christos@lemmy.world to Linux Gaming@lemmy.worldEnglish · 13日前

Terminal Tower of Hanoi, in Bash

lemmy.world

message-square
11
link
fedilink
  • cross-posted to:
  • opensource@programming.dev
  • linux@lemmy.world
  • linux@lemmy.ml
78

Terminal Tower of Hanoi, in Bash

lemmy.world

christos@lemmy.world to Linux Gaming@lemmy.worldEnglish · 13日前
message-square
11
link
fedilink
  • cross-posted to:
  • opensource@programming.dev
  • linux@lemmy.world
  • linux@lemmy.ml

cross-posted from: https://lemmy.world/post/47988648

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

  • besmtt@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    12日前

    1023 for 10 disks, 5011 for 9 disks

    More moves for less disks?

    • christos@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      8
      ·
      12日前

      Yup, this is fat finger mathematics. The correct number is 511, somehow zero got in the way.

      • besmtt@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        12日前

        Okay gotcha. Thank you!

        • christos@lemmy.worldOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          11日前

          I have just updated the script, now up to 13 disks available (optimal moves: 8191).

          It will take a while to solve it…

Linux Gaming@lemmy.world

linux_gaming@lemmy.world

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !linux_gaming@lemmy.world

Discussions and news about gaming on the GNU/Linux family of operating systems (including the Steam Deck). Potentially a $HOME away from home for disgruntled /r/linux_gaming denizens of the redditarian demesne.

This page can be subscribed to via RSS.

Original /r/linux_gaming pengwing by uoou.

No memes/shitposts/low-effort posts, please.

Resources

Help:

  • ProtonDB
  • Are We Anticheat Yet?
  • r/linux_gaming FAQ
  • Fork of an earlier version of the above
  • PCGamingWiki
  • LibreGameWiki

Launchers/Game Library Managers:

  • Faugus Launcher
  • Bottles
  • Lutris
  • Heroic Games Launcher

General:

  • Gaming on Linux
  • Boiling Steam
  • Phoronix
  • Linux VR Adventures

Discord:

  • Gaming on Linux
  • Linux Gamers Group
  • Linux Gaming
  • Lutris

IRC:

  • Gaming on Linux

Matrix:

  • Linux Gamers Group (space)
  • Linux Gamers Group (“home” room)
  • Linux Gaming

Telegram:

  • Gaming on Linux
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 312 users / day
  • 913 users / week
  • 2.73K users / month
  • 4.45K users / 6 months
  • 1 local subscriber
  • 26.3K subscribers
  • 255 Posts
  • 2.22K Comments
  • Modlog
  • mods:
  • monolalia@lemmy.world
  • BE: 0.19.15
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org