Skip to content

Instantly share code, notes, and snippets.

@btaitelb
Created November 14, 2017 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btaitelb/9fd29852a6e4c0129d0c4bdbe0f5d81c to your computer and use it in GitHub Desktop.
Save btaitelb/9fd29852a6e4c0129d0c4bdbe0f5d81c to your computer and use it in GitHub Desktop.
require './dice_game'
class WaitForOdds
include DiceGame
def winner?
@rolls ||= []
if @rolls.size >= 3
@rolls[-3..-1].all?{|r| r % 2 == 1}
else
false
end
end
end
WaitForOdds.new.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment