Class: ChooseAnswerGame
- Inherits:
-
Object
- Object
- ChooseAnswerGame
- Defined in:
- lib/learn-japanese/game/choose-answer-game.rb
Class Method Summary collapse
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 |
# File 'lib/learn-japanese/game/choose-answer-game.rb', line 8 def initialize(level=1, max=10) @level = level @score = 1 @max_score = max = Hiragana.group1 .merge! Hiragana.group2 if @level > 1 .merge! Hiragana.group3 if @level > 2 .merge! Hiragana.group4 if @level > 3 @keys = .keys end |
Class Method Details
.show_help(level = 1) ⇒ Object
21 22 23 |
# File 'lib/learn-japanese/game/choose-answer-game.rb', line 21 def self.show_help(level=1) Hiragana.show_help(level) end |
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 |
# File 'lib/learn-japanese/game/choose-answer-game.rb', line 25 def run Debug.puts_line while @score < @max_score guess_japanise_symbol(@keys) end end |