Skip to content

Instantly share code, notes, and snippets.

@leklund
leklund / game.rb
Created October 30, 2011 22:38
Rock, paper, scissors, lizard, spock in Sinatra
require 'sinatra'
# before we process a route, we'll set the response as
# plain text and set up an array of viable moves that
# a player (and the computer) can perform
before do
content_type :txt
@defeat = {
rock: [:scissors, :lizard],
paper: [:rock, :spock],