Sha256: 733037cb6ffe23c1fa9a6a099c86f5cc27aa9390d54a8947cbf5407682406397

Contents?: true

Size: 683 Bytes

Versions: 1

Compression:

Stored size: 683 Bytes

Contents

require 'yahtzee'
require 'dice'
require 'round'
require 'scoring'

# This module is the imperative shell of sorts. It provides
# the 'DSL' of the Yahtzee library and is mostly a wrapper
# for internals, 'gluing' the application together from a
# bunch of functions into a cohesive playable game.
#
module Yahtzee
  module Game
    include Yahtzee::Errors
    include Yahtzee::Scoring
    include Yahtzee::Dice

    module_function

    def first_roll
      Dice.roll(5)
    end

    def second_roll(keepers)
      Dice.reroll(keepers)
    end
    # tricky - todo: alias_method :third_roll, :second_roll
    
    def third_roll(keepers)
      Dice.reroll(keepers)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
functional-yahtzee-0.0.3 lib/game.rb