def play
      @start = Time.now
      results = body.map { |line| Line.new(line:line, stats:stats).play unless line == ""}
      self.time = Time.now - @start
      self.chars = results.map {|s| s[:chars] }.inject(:+)
      self.correct_chars = results.map {|s| s[:correct_chars] }.inject(:+)
      self.words = results.map {|s| s[:words] }.inject(:+)
      self.keystrokes  = results.map {|s| s[:keystrokes] }.inject(:+)
      self.typing_accuracy = (correct_chars.to_f / keystrokes.to_f * 100).to_i
      self.word_accuracy   = (correct_chars.to_f / chars.to_f * 100).to_i # TODO
      self.gross_wpm = words / (time / 60)
      stats.record_exercise(self)
      return results
    end
def play
      @start = Time.now
      results = body.map { |line| Line.new(line:line, stats:stats).play unless line == ""}
      self.time = Time.now - @start
      self.chars = results.map {|s| s[:chars] }.inject(:+)
      self.correct_chars = results.map {|s| s[:correct_chars] }.inject(:+)
      self.words = results.map {|s| s[:words] }.inject(:+)
      self.keystrokes  = results.map {|s| s[:keystrokes] }.inject(:+)
      self.typing_accuracy = (correct_chars.to_f / keystrokes.to_f * 100).to_i
      self.word_accuracy   = (correct_chars.to_f / chars.to_f * 100).to_i # TODO
      self.gross_wpm = words / (time / 60)
      stats.record_exercise(self)
      return results
    end
instance methods