Class: RomajiGame

Inherits:
Object
  • Object
show all
Defined in:
lib/learn-japanese/game/romaji-game.rb

Instance Method Summary collapse

Constructor Details

#initialize(level = 1, max = 10) ⇒ RomajiGame

Returns a new instance of RomajiGame.



9
10
11
12
13
14
15
# File 'lib/learn-japanese/game/romaji-game.rb', line 9

def initialize(level=1, max=10)
  @level = level
  @score = 1
  @max_score = max

  @words = Dictionary.words
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
# File 'lib/learn-japanese/game/romaji-game.rb', line 17

def run
  Debug.puts_line
  while @score < @max_score
    @words.shuffle!
    guess_romaji(@words.first)
  end
end