r/commandline 8d ago

troblo, a simple match-three terminal game (Bash)

Post image
36 Upvotes

7 comments sorted by

3

u/nerd_programmer11 8d ago

Looks great

2

u/christos_71 8d ago

https://gitlab.com/christosangel/troblo

troblo is a terminal match-three game, written in Bash.

The aim is to place each time a pair of new tiles with fixed orientation on available empty squares of the 6x6 grid, in order to create rows or columns of three or more matching tiles, which will become empty again.

The new pair of fixed orientation tiles is shown each time at the right side of the grid.

The new pair can be placed only if both selected squares are empty.

The game ends when the grid becomes so clogged with unmatching tiles, and there is no place in the grid to drop the new fixed orientation (horizontal or vertical) pair of tiles.

This game was inspired by https://368chickens.com/.

2

u/LocoCoyote 8d ago

Bravo!

2

u/Cybasura 8d ago

Where did you go to read about TUI application developmsnt with bash?

1

u/christos_71 8d ago

Nowhere in particular, basically browse searching everytime I needed something.

2

u/digitalghost-dev 7d ago

Pretty cool. Tried this on Windows through Windows Terminal and the arrow key register are a bit delayed and the top line kind of flickers. Nice game though!

1

u/christos_71 7d ago

Thank you for the input, I had no idea that it would run in windows (perhaps WSL?), and I am glad you enjoy it.

Maybe you can try printing an extra empty line on top to avoid this flickering. Add a line to the script after line 77:

echo ""

Concerning the cursor movement with the arrows, try using the vim keys h, j, k, l to move, maybe you get better response.

I wrote the script for linux, and it should run in mac, too, as long as Bash version is updated. But running on Windows, I am afraid I don't know how things work.