Bash2048 – A 2048 Game in the Terminal

📅 February 12, 2024
Remember the game 2048? Let’s play it in a terminal!

Here is a fun variation on the addictive “How far can you go?” number combining puzzle game — but from a bash script.

Installation

Bash2048 is not in the Ubuntu repository. Download it from https://github.com/JosefZIla/bash2048, and place it anywhere you like for easy access. All you need is the file bash2048.sh.

Run It!

Just run it like any other script.

bash bash2048.sh

Or, if you have the execute permission set on the file,

./bash2048.sh

Gameplay

The gameplay and controls are just like the original…but in a bash shell. The arrow keys are all you need to combine numbers in hopes of reaching the magical 2048. (These are powers of 2, so this is good practice in learning the progression from 2.)

bash2048 in action! Use the arrow keys to move and CTRL-C to quit and save.

Look, Ma! My first 64 in a bash shell!

A GUI version of the game 2048 for comparison.

While the terminal graphics might not be as flashy as the GUI version, this is a good script-based game. Gameplay is still as challenging as the original. No slowdown or clunky behavior.

256! Let’s stop while ahead. CTRL-C will quit the game at any time with a prompt to save the game.

To reload a saved game, use the -r option.

bash bash2048.sh -r

Resume from where you left off if you need to take breaks.

Have fun!

, , ,

  1. Leave a comment

Leave a comment