Skip to content

JacksonLaVallee/2048

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048

Jackson La Vallee

Description

This project is an implementation of the classic 2048 game in Rust. The game features a 4x4 grid where players combine numbered tiles by sliding them in four directions. The goal is to create a tile with the number 2048.

Key features include:

  • Command-line interface
  • Save and load game functionality
  • Undo move capability
  • Score tracking

This implementation utilizes the following 3rd party crates:

  • rand for random number generation
  • serde and serde_json for game state serialization

Installation

To install and compile the project, follow these steps:

  1. Ensure you have Rust and Cargo installed on your system.
  2. Clone the repository: git clone https://github.com/rustvu-2024f/project-JacksonLaVallee.git
  3. Navigate to the project directory: cd project-JacksonLaVallee
  4. Build the project: cargo build --release

The compiled binary will be located in target/release/.

How to use

To start the game, run the following command in the project directory:

cargo run --release

Game controls:

  • Use 'w', 'a', 's', 'd' keys to move tiles up, left, down, and right respectively
  • 'u' to undo the last move
  • 'k' to save the current game state
  • 'l' to load a previously saved game state
  • 'q' to quit the game

Example gameplay:

  1. Start the game
  2. Press 'd' to move tiles right
  3. Press 'w' to move tiles up
  4. Continue playing until you reach 2048 or no more moves are possible
  5. Use 'k' to save your progress at any time
  6. Use 'l' to load a saved game in a future session

The game will display the current board state, score, and available moves after each turn.

About

My take on the classic game -- in Rust!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages