Sha256: e345d2f33744ed4951810c16ff43311fbcf688cc85899e5d246d4effb87dbc65

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

require 'tarzan/games/base/game'
require 'tarzan/games/odds_and_evens/move'

module Tarzan
  module Games
    module OddsAndEvens
      class Game < Base::Game

      private

        def rules
          'Odd sum wins, even sum loses'
        end

        def prompt_move
          choice = @interface.prompt(Move.valid).to_i
          Move.new choice: choice, wins_on_odds: true
        end

        def random_move
          choice = Move.valid.sample
          Move.new choice: choice, wins_on_odds: false
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tarzan-0.0.3 lib/tarzan/games/odds_and_evens/game.rb