Here's another, more serious, attempt (still in Ruby) :
defadd(a,b)(-a...b).sizeend
Some explanations : in Ruby 0..10 is called a range. It is really useful to make arbitrary loops or splice an array, for example. Simply, a range is a suite of values. The syntax I used here is 0...10 (note the three dots) which is an exclusive range : the suite of values goes from 0 to 9. So the trick is to have a range going from -a to b and excluding b because 0 is included in the suite.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here's another, more serious, attempt (still in Ruby) :
Some explanations : in Ruby
0..10
is called a range. It is really useful to make arbitrary loops or splice an array, for example. Simply, a range is a suite of values. The syntax I used here is0...10
(note the three dots) which is an exclusive range : the suite of values goes from0
to9
. So the trick is to have a range going from-a
tob
and excludingb
because0
is included in the suite.