Created
December 27, 2015 00:21
-
-
Save becker1701/e3db10f8de9c02af19c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hands | |
# Actions is mixed into Hand class | |
# @cards is a Hand instance variable that is an array of Card objects | |
module Actions | |
def hit(stock) | |
def double(stock) | |
def split(player, stock) | |
end | |
module Compare | |
def player_wins(other) | |
def player_ties(other) | |
def player_looses(other) | |
def result_multiplier(other) | |
end | |
module Calculate | |
def value(dealer: false, game_over: false) | |
def adjust_aces(value) | |
end | |
class Hand | |
include Hands::Actions | |
include Hands::Compare | |
include Hands::Calculate | |
# ... | |
end | |
end | |
# Hands::Hand.new for a new hand object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment