292
submitted 8 months ago by christos@lemmy.world to c/linux@lemmy.ml

https://gitlab.com/christosangel/tui-mines

tui mines is evidently a text-based user interface implimentation of the classic mine sweeping puzzle game.

The user has to clear a board, square by square, flagging the squares suspected to hide mines on the way.

If the user opens a mine square, things go KABOOM! and the game is lost.

The user uses hints from the numbered squares. This numbers how many bombs are touching that square in every direction ( 8 in total).

Through logic, and a bit of luck, the player ends up clearing all the squares, while flagging all the mines.

all 18 comments
sorted by: hot top controversial new old
[-] muhyb@programming.dev 17 points 8 months ago

click Noice!

[-] uranibaba@lemmy.world 8 points 8 months ago

Is it possible to use wasd instead of hjkl? I'm not old enough for that.

[-] christos@lemmy.world 11 points 8 months ago

Here is the solution just for you:

  • get to the tui-mines/ directory
  • open a terminal there
  • run this command sed -i 's/k|A/w|A/;s/h|D/a|D/;s/j|B/s|B/;s/l|C/d|C/' tui-mines.sh

Run the script ./tui-mines.sh

You can now play using lower case awsd.

[-] uranibaba@lemmy.world 2 points 8 months ago

Haven't had the time to use my computer yet, but I will update you soon. ™️

[-] christos@lemmy.world 7 points 8 months ago

IMPORTANT UPDATE: Since many youngsters who unlike me, a senior citizen, live on the edge and hate vim keys or arrow keys, have requested an alternative navigation keys set up, I have just implemented a configuration option that satisfies just that.

By editing the config file (either within the application or just editing ~/.config/tui-mines/tui-mines.config, and changing the NAVIGATION_KEYS value from vim+arrows (default) to aswd+arrows, the user can use the aswd keys to navigate in the game grid, just as requested.

No other commands or hacks are needed.

Arrow keys remain hardcoded, because they remind me of my youth, as an archer, during the Peloponnesian War

[-] uranibaba@lemmy.world 2 points 8 months ago
[-] christos@lemmy.world 2 points 8 months ago

Wait up, I am preparing one command for you, you run it, and you use your keys as you wish. Just don' put caps lock!

[-] christos@lemmy.world 2 points 8 months ago

Let me know if it works.

[-] christos@lemmy.world 2 points 8 months ago

And to see the correct cheatsheet as well: sed -i 's/hjkl/awsd/' tui-mines.sh

[-] gaael@lemmy.world 1 points 8 months ago* (last edited 8 months ago)

From the gitlab page:

The user can move the cursor with h,j,k,l (vim keys), or the arrow keys.

[-] christos@lemmy.world 1 points 8 months ago

It is not impossible. Are you up to modify 4 lines of code?

[-] t0mri@lemmy.ml 6 points 8 months ago
[-] dododo@feddit.de 6 points 8 months ago

Now combine this with Suicide Linux and you have a perma death mode.

[-] christos@lemmy.world 3 points 8 months ago

Welp, also solves the 'Which distro to use?' issue.

[-] some_guy@lemmy.sdf.org 3 points 8 months ago
[-] eugenia@lemmy.ml 2 points 8 months ago

Very nice script! Looks great! Πολυ ωραιο, μπραβο!

[-] christos@lemmy.world 2 points 8 months ago

Ευχαριστω!

this post was submitted on 27 Mar 2024
292 points (98.7% liked)

Linux

48376 readers
1019 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 5 years ago
MODERATORS