This seems almost trivial, but since after some effort I was not able to beat the literal solution in J, I thought it might make a decent challenge (though, to be clear, this is not a J-specific challenge).
Title says it all. You simply need to write a program, or function (taking no arguments) that returns or prints:
N NE E SE S SW W NW
You may use newlines in place of spaces.
A no-argument function returning an array of strings such as
['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW']
is also acceptable.
The letters may be upper or lower case, but may not be mixed.
0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5
. Unfortunately the J code required to then map those results into letters ended up being more expensive than a literal.
1, 1+i, i, -1+i, -1, -1-i, -i, 1-i
so you've got one real or imaginary part per cardinal direction instead of two. It's probably harder to generate those though, unless there's some way you could round those powers of i away from 0? I don't know how easy or hard that would be in J, but it's an idea.