Codility Practice
Write a function that accepts two numbers a and b and returns whether a is smaller than, bigger than, or equal to b, as a string.
There is only one problem...
You cannot use if statements, and you cannot use the ternary operator ?
In fact, the word if and the character ? are not allowed in your code.
BDD (Behavior Driven Development)
Given: a and b
When: The values are compared
Then: Return an array showing their comparison
Example1
(5, 4) ---> "5 is greater than 4"
(-4, -7) ---> "-4 is greater than -7"
(2, 2) ---> "2 is equal to 2"
Give two numbers (a) and (b) --> (5, 4)
Display which number is greater --> "5 is greater than 4"
The code is available in no_ifs_no_buts.rb