How marctheduck/rock_paper_scissors_rs works
This is a small terminal Rock Paper Scissors game. The user supplies a move, the game parses it and generates a computer move, compares them, updates and displays the running score, then asks whether to continue. The source shows the main loop and its calls; there is no README documentation.
Main entry points: main.rs Game loop · rps.rs Moves and rules · utils.rs Terminal input · score.rs Score state
Components 6
Game flow
- Game loop
src/main.rs - Moves and rules
src/rps.rs
Input and state
- Score state
src/score.rs - Terminal input
src/utils.rs
Other components
- Player
- Random generator
Connections 10
- Player → Terminal input: enters text
- Game loop → Score state: creates and updates
- Game loop → Score state: reads display
- Game loop → Moves and rules: parses move
- Moves and rules → Terminal input: reads prompt
- Game loop → Moves and rules: generates move
- Moves and rules → Random generator: chooses randomly
- Game loop → Moves and rules: compares moves
- Game loop → Terminal input: asks to continue
- Terminal input → Player: returns text