Class: RomanjiGame

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RomanjiGame.



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

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

  @words = Dictionary.words
end

Instance Method Details

#runObject



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

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