Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cqb13/terminal-lights-out
This game is a light toggle puzzle built in Rust. The goal is to toggle all lights off on a 5x5 grid to solve the puzzle. The game randomly generates a starting board with a number of lights turned on, and the player must find a sequence of moves to turn all lights off.
https://github.com/cqb13/terminal-lights-out
game lights-out lights-out-game rust rust-terminal-game terminal-game tui
Last synced: 15 days ago
JSON representation
This game is a light toggle puzzle built in Rust. The goal is to toggle all lights off on a 5x5 grid to solve the puzzle. The game randomly generates a starting board with a number of lights turned on, and the player must find a sequence of moves to turn all lights off.
- Host: GitHub
- URL: https://github.com/cqb13/terminal-lights-out
- Owner: cqb13
- License: mit
- Created: 2024-04-13T20:52:55.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-04-17T18:38:30.000Z (9 months ago)
- Last Synced: 2024-11-02T20:42:38.500Z (2 months ago)
- Topics: game, lights-out, lights-out-game, rust, rust-terminal-game, terminal-game, tui
- Language: Rust
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lights Out Game in Rust
This game is a light toggle puzzle built in Rust. The goal is to toggle all lights off on a 5x5 grid to solve the puzzle. The game randomly generates a starting board with a number of lights turned on, and the player must find a sequence of moves to turn all lights off.
## Features
- **Grid Generation:** Randomly generates game boards.
- **Game Solver:** Includes an algorithm to find solutions to any given game state.
- **Interactive Play:** Allows users to play manually and see the effects of their actions in real-time.
- **Solution Calculation:** Automatically calculates and displays the minimum number of moves required to solve the game.## Usage
To play or solve the Lights Out game, follow these steps:
1. Clone the repository to your local machine.
```sh
git clone https://github.com/cqb13/terminal-lights-out.git
```2. Run the game using Cargo:
```sh
cargo run
```Upon running, the program will prompt you to choose between playing the game manually or solving a puzzle.
### Play Mode
In Play mode, you interact with the game board by toggling lights to turn off all lights. The game displays the current board state and lets you choose lights to toggle.
### Solve Mode
In Solve mode, the game automatically calculates and displays the solution to the entered puzzle. The solution consists of a sequence of moves (represented by numbers) to turn off all lights.
## Contributing
Contributions are welcome! If you have suggestions for improvements or find a bug, please open an issue or submit a pull request.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.