Hello, this is my first Kata so forgive me if it is of poor quality.
In this Kata you should fix/create a program that returns the following values:
false/Falseif either a or b (or both) are not numbersa % bplusb % aif both arguments are numbers
You may assume the following:
- If
aandbare both numbers, neither ofaorbwill be0.
In this Kata you should try to fix all the syntax errors found in the code.
Once you think all the bugs are fixed run the code to see if it works. A correct solution should return the values specified in the overview.
Extension: Once you have fixed all the syntax errors present in the code (basic requirement), you may attempt to optimise the code or try a different approach by coding it from scratch.
def my_first_kata(a,b)
if a.type or b.type == "number" return False
else
return a % b ++ b % a end
enddef my_first_kata(a,b)
return false if a.class != Integer || b.class != Integer
a % b + b % a
enddef my_first_kata(a,b)
a % b + b % a rescue false
end