num_solve.rb
# Iterates through all 4 mathematical operations to test
Iterates through all 4 mathematical operations to test
Iterates through all 4 mathematical operations to test
def pick_op (a, b, numbers, answer, solution)
  test(a, b, "+", a+b, numbers, answer, solution.clone)
  test(a, b, "-", a-b, numbers, answer, solution.clone)
  test(a, b, "*", a*b, numbers, answer, solution.clone)
  test(a, b, "/", a/b, numbers, answer, solution.clone) if (b != 0 && a % b == 0) 
end
def pick_op ( a , b , numbers , answer , solution ) test ( a , b , "+" , a + b , numbers , answer , solution . clone ) test ( a , b , "-" , a - b , numbers , answer , solution . clone ) test ( a , b , "*" , a * b , numbers , answer , solution . clone ) test ( a , b , "/" , a / b , numbers , answer , solution . clone ) if ( b != 0 && a % b == 0 ) end
Iterates through all 4 mathematical operations to test
Iterates through all 4 mathematical operations to test
#avoid divide by zero and fractions
a
b
numbers
answer
solution