How karinatiurina/rock_paper_scissors works
This Rails app serves a browser-based Rock–Paper–Scissors game. A player opens the game, chooses rock, scissors, or paper, and the show action generates a computer choice, determines the winner or a draw, and renders the result. The rules and random choice are implemented directly in the controller; no persistence layer is indicated. The view files are present in the tree, but their contents were not sampled, so their detailed form and rendering behavior is inferred from the README and filenames.
Main entry points: games_controller.rb Games controller · routes.rb Game routes · new.html.erb New game view · show.html.erb Round result view
Components 6
Web entry
- Game routes
config/routes.rb
Game round
- Games controller
app/controllers/games_controller.rb - Choice and winner
app/controllers/games_controller.rb
Game interface
- New game view
app/views/games/new.html.erb - Round result view
app/views/games/show.html.erb
Other components
- Player
Connections 8
- Player → Game routes: requests game
- Game routes → Games controller: dispatches
- Games controller → New game view: renders new
- New game view → Player: offers choices
- Player → Game routes: submits choice
- Games controller → Choice and winner: generates and judges
- Games controller → Round result view: renders result
- Round result view → Player: displays outcome