This is a simple console-based Rock, Paper, Scissors game implemented in Rust.
This project serves as an introduction to Rust programming, demonstrating basic concepts such as:
- Enumerations (
enum Choicesrepresenting the player and computer choices: Rock, Paper, or Scissors). - Methods for enums (
from_strandto_emoticonfor converting input strings and representing choices with emoticons). - Error handling using
Optionandexpect. - Looping (
loop) and conditional branching (if,match) for game flow control. - Random number generation using the
randcrate.
-
Clone the repository:
git clone https://github.com/yourusername/rock-paper-scissors.git
-
Navigate into the project directory:
cd rock-paper-scissors -
Build and run the application:
cargo run
-
Follow the on-screen instructions to play Rock, Paper, Scissors:
- Choose between Rock (🪨), Paper (📃), or Scissors (✂️).
- To quit the game, enter
q.
- Play Rock, Paper, Scissors against the computer.
- Simple and intuitive user interface.
- Emoticon representation of choices for visual appeal.
This application uses the standard library std::io for user input/output and the rand crate for random number generation.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.