Sha256: b393d4a64efaf3ab96163b77dc417cef98a074e9087208c9d82122f4b898e3b2
Contents?: true
Size: 569 Bytes
Versions: 1
Compression:
Stored size: 569 Bytes
Contents
module Mathy class Game def initialize(player, score = 0) @player = player @score = score end def play(console) turns_played = play_turns(console) console.display_results(@player, @score, turns_played) end private def play_turns(console) turns_to_play = console.how_many_turns? turns_to_play.times do @score += 1 if operation(console).play_turn end turns_to_play end def operation(console) @operation ||= console.difficulty?.choose_operation(console) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mathy-0.0.2 | lib/mathy/game.rb |