Skip to content

wmanica/rock-paper-scissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock-Paper-Scissors

Ruby on Rails project for a version of the game Rock Paper Scissors aka Rochambeau

What it does

  • The application should allow a user to choose 'rock', 'paper', or 'scissors'
  • The application make a request to a external api to retrieve the server’s throw.
  • If the external does not work, an alternative is generated by this app.
  • The application should responds with a JSON response indicating whether the user won, lost or tied

Game Rules

  • Rock beats scissors
  • Scissors beats paper
  • Paper beats rock
  • Identical throws tie (rock == rock, etc.)

Setup

Local

  1. install ruby v3.0.4. Check rbenv for more info

  2. install the required gems. Do this at the app directory:

$ bundler
  1. serve the API:
$ rails s
  1. Do a POST HTTP request to the API endpoint and send your throw as a body, for example:
curl -v -H 'Content-Type: application/json' -X POST "http://localhost:3000/api/rps" -d '{"player_throw": {"throw":"rock"}}'

About

Ruby 3.0.4 Rails 7.0.4

Versions

Current version: 1.0.0

Changelog

The changelog can be found here.

About

Rock Paper Scissors game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published