/my-2048

Primary LanguagePython

2048 Game

forthebadge forthebadge

This project contains three main files for different versions.

  • game_2048_no_gui.py is written in python with no gui.

  • game_2048_with_gui.py is written in python with gui.

  • Game.java is written in java with no gui.

How to play

For Python:

$ python3 game_2048_no_gui.py
$ python3 game_2048_with_gui.py

For Java:

$ javac Game.java
$ java Game

Test cases

[0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0]

+-----+-----+-----+-----+
|     |   4 |     |     |
+-----+-----+-----+-----+
|     |     |     |     |
+-----+-----+-----+-----+
|     |   2 |     |     |
+-----+-----+-----+-----+
|     |   2 |     |     |
+-----+-----+-----+-----+

[0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0]

+-----+-----+-----+-----+
|     |     |     |     |
+-----+-----+-----+-----+
|     |   2 |     |     |
+-----+-----+-----+-----+
|     |   2 |     |     |
+-----+-----+-----+-----+
|     |   4 |     |     |
+-----+-----+-----+-----+

Have fun!

Wish you a nice day.