This repository contains two different implementations of the classic 2048 puzzle game. One is a text-based version, and the other is a GUI-based version using Swing.
- Run.java: A simple, text-based version of the game.
- Game2048.java: A GUI-based version of the game built using Swing.
- Navigate to the directory containing
run.java. - Compile the file:
javac run.java
- Run the program:
java run
- Use the following commands to control the game:
left: Move tiles left.right: Move tiles right.up: Move tiles up.down: Move tiles down.restart: Restart the game.exit: Exit the game.
- Navigate to the directory containing
Game2048.java. - Compile the file:
javac Game2048.java
- Run the program:
java Game2048
- Control the game using:
- Arrow keys (Up, Down, Left, Right) or
W(Up),A(Left),S(Down),D(Right).