15
1
Challenge
Given input in the form <n1>, <n2>
where number can be -1, 0, or 1, return the corresponding cardinal direction. Positive numbers move East in the x-axis and South in the y-axis, Negative numbers move West in the x-axis and North in the y-axis.
Output must be in the form South East
, North East
, North
. It is case-sensitive.
If the input is 0, 0, your program must return That goes nowhere, silly!
.
Sample Input/Outpot:
1, 1
-> South East
0, 1
-> South
1, -1
-> North East
0, 0
-> That goes nowhere, silly!
This is code-golf, the shortest answer in bytes wins.
Loosely related – HyperNeutrino – 2017-03-23T21:49:46.467
1Some examples with W, NW and SW are needed. – seshoumara – 2017-03-23T22:10:15.807
@seshoumara I'm on mobile, so no backticks, but NW would be -1, -1 – Matias K – 2017-03-23T23:41:09.617
1Are trailing Spaces allowed? – Arjun – 2017-03-23T23:53:40.483
Uhh... Sure, I guess. As long as it looks the same. – Matias K – 2017-03-24T00:45:00.417
Can we take
+1
instead of1
? – user41805 – 2017-03-24T07:38:42.427No (15 chars minimum to comment) – Matias K – 2017-03-24T07:40:49.723
Can we take the numbers in the opposite order?
1, 0
is "South"? – Stewie Griffin – 2017-03-24T10:21:21.860No. Must be x, y. – Matias K – 2017-03-24T10:22:19.413
Can we take numbers as two separate command-line arguments? – Erik the Outgolfer – 2017-03-24T12:29:39.097
@EriktheOutgolfer Yes, you can. – Matias K – 2017-03-24T22:14:52.333