This is a fairly simple challenge.
Write a program that computes the distance between two points on a 2D plane. However, you can't use any functions or operators (referred to here as symbols) that are 1 character long.
%=, etc. are allowed.
++are allowed as well.
*are not allowed.
f(x)is not allowed, but
S 5 4is not allowed, but
SUM 5 4is.
- Simply putting two separate single-character operators one after the other is not allowed, eg.
- Single semicolons or the equivalent are allowed, e.g.
foo();, as long as they are being used as an end-of-command symbol.
- Commas (
,) and periods (
.) are allowed.
- Parentheses (
()) and other symbols that are used in such a way to require a second match are allowed. Examples:
foo();is allowed, as is
if(1<2 && 2>3)is not allowed, as the symbols are being interpreted as greater than and less than symbols, and so do not require the other.
][is not allowed, as the symbols do not match.
- Essentially, the interpreter/compiler/etc.(?) should recognize the symbols as matching.
- Whitespace does not count for the single character rule, e.g.
this == thatand
this ==thatetc. are both allowed.
- Standard rules for loopholes etc. apply.
- Input can be in any reasonable format of two points. Examples:
new Point(0,0), new Point(5,6)
- Output should be a double or equivalent with 5 significant digits.
- No eval!
- This is code-golf, so shortest allowed and functioning code wins!
*You would have to construct the objects a different way, as colons are single symbols.
Good luck without being able to use the
= operator! :P
Edit: Imaginary 5 kudo points for not using a built-in.