Class: Mathy::Difficulties::GradeTwo

Inherits:
Object
  • Object
show all
Defined in:
lib/mathy/difficulties/grade_two.rb

Instance Method Summary collapse

Instance Method Details

#choose_operation(console) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/mathy/difficulties/grade_two.rb', line 8

def choose_operation(console)
  verifier = Verification.new(console)
  console.operation?([
    Operations::Operation.new(self, "+", verifier),
    Operations::Operation.new(self, "-", verifier)
  ])
end

#next_operandsObject



4
5
6
# File 'lib/mathy/difficulties/grade_two.rb', line 4

def next_operands
  [rand(20), rand(20)].sort.reverse
end