GithubHelp home page GithubHelp logo

cqb13 / terminal-lights-out Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 14 KB

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.

License: MIT License

Rust 100.00%
game lights-out lights-out-game rust terminal-game tui rust-terminal-game

terminal-lights-out's Introduction

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.
git clone https://github.com/cqb13/terminal-lights-out.git
  1. Run the game using Cargo:
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 file for details.

terminal-lights-out's People

Contributors

cqb13 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.