Class: ChooseAnswerGame
- Inherits:
-
Object
- Object
- ChooseAnswerGame
- Defined in:
- lib/learn-japanese/game/choose-answer-game.rb
Instance Method Summary collapse
-
#initialize(level = 1, max = 10) ⇒ ChooseAnswerGame
constructor
A new instance of ChooseAnswerGame.
- #run ⇒ Object
Constructor Details
#initialize(level = 1, max = 10) ⇒ ChooseAnswerGame
Returns a new instance of ChooseAnswerGame.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/learn-japanese/game/choose-answer-game.rb', line 8 def initialize(level=1, max=10) @hiragana = Hiragana.new @level = level @score = 1 @max_score = max #@silabario = Hiragana.group1 #@silabario.merge! Hiragana.group2 if @level > 1 #@silabario.merge! Hiragana.group3 if @level > 2 #@silabario.merge! Hiragana.group4 if @level > 3 #@silabario.merge! Hiragana.group4 if @level > 4 #@silabario.merge! Hiragana.group5 if @level > 5 #@silabario.merge! Hiragana.group6 if @level > 6 levels = (1..@level).to_a @silabario = @hiragana.groups(levels) @keys = @silabario.keys end |