How marmargames/guessing-game works
This is a small Rust web server for a browser-based number-guessing game. A player loads the game page, starts a game to receive an ID, then submits guesses; the server keeps each game's secret and progress in mutex-protected in-memory state and returns results and updated bounds. The source excerpt establishes routes, handlers, and embedded HTML, but the HTML contents were not provided, so browser-side interactions are not mapped in detail.
Main entry points: main.rs HTTP server and routes · index.html Game page
Components 5
Web interface
- HTTP server and routes
project/guessing_game_server/src/main.rs - Game page
project/guessing_game_server/src/index.html
Game runtime
- Game API handlers
project/guessing_game_server/src/main.rs - In-memory game state
project/guessing_game_server/src/main.rs
Other components
- Player
Connections 5
- Player → HTTP server and routes: sends requests
project/guessing_game_server/src/main.rs - HTTP server and routes → Game page: serves embedded
project/guessing_game_server/src/main.rs - HTTP server and routes → Game API handlers: routes API
project/guessing_game_server/src/main.rs - Game API handlers → In-memory game state: reads and updates
project/guessing_game_server/src/main.rs - Game API handlers → Player: returns JSON
project/guessing_game_server/src/main.rs