Commit 4e6f5ca

mo khan <mo@mokhan.ca>
2014-04-26 19:02:26
move difficult prompt to console so the player can choose.
1 parent bcff8ec
Changed files (2)
bin
lib
bin/mathy
@@ -4,7 +4,6 @@ require 'mathy'
 
 module Mathy
   console = Console.new
-  difficulty = Difficulties::GradeTwo.new
   game = Game.new(Player.new(console.greet), console)
-  game.play(console.how_many_turns?, difficulty)
+  game.play(console.how_many_turns?, console.difficulty?)
 end
lib/mathy/console.rb
@@ -14,6 +14,10 @@ module Mathy
       operations.find { |operation| operation.matches?(selection) }
     end
 
+    def difficulty?
+      Difficulties::GradeTwo.new
+    end
+
     def prompt?(question)
       puts question
       gets.strip