Skip to content

Instantly share code, notes, and snippets.

@wofockham
Last active August 29, 2015 14:13
Show Gist options
  • Save wofockham/56f8d794c405a8d7cae6 to your computer and use it in GitHub Desktop.
Save wofockham/56f8d794c405a8d7cae6 to your computer and use it in GitHub Desktop.

Games on Sinatra

Summary

Games on Sinatra is a web application with three games

  • Magic 8 Ball
  • Secret Number
  • Rock Paper Scissors

Magic 8 Ball

  • Magic 8 ball takes user's questions and returns an eerily prescient answer.

Secret Number

  • Users click a number between 1 and 10. The controller validates the guess and renders the win or lose view.

Rock Paper Scissors

  • Create a URL in this form: /games/rock_paper_scissors/:throw
  • Use params[:throw] as the user's choice (i.e. /games/rock_paper_scissors/rock)
  • Compare the 2!

Extensions

  • Styling
  • Rock Paper Scissors Lizard Spock

CRUD review

  • Annotate our butterfly application with comments. Make sure you understand it.
  • Bonus: Repeat the steps we followed to build your own CRUD app for a database of your choosing (for example: a blog)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment