Implement Point
so that:
new Point( new Point(10, 20) + new Point(30, 50) ).toString() === '{40,70}'
Must be generic and be able to handle x
and y
values from 0..999 (integers only)
Minor hint: you'll need to implement valueOf
and toString
methods.
@davidaurelio, cool!
So, so far we have two string-based solutions and two numerical. The string-based solutions theoretically allow floating-points with decimals while the numerical ones allow general arithmetic operators.