3 added 1 character in body
source | link

Given a string that is one of the directions on a 16-point compass rose

16-point compass rose

output the two directions that are immediately adjacent to the input direction, in clockwise order.

Specifically, you need to handle these (and only these) input/output pairs:

Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N

The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately counterclockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.

For example, for input N (or n if you're using lowercase) some valid outputs are:

NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)

Some invalid outputs are:

NNWNNE
NNE NNW
nnwNNE
NNwNNeNNw NNe

The shortest code in bytes wins.

Given a string that is one of the directions on a 16-point compass rose

16-point compass rose

output the two directions that are immediately adjacent to the input direction, in clockwise order.

Specifically, you need to handle these (and only these) input/output pairs:

Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N

The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately counterclockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.

For example, for input N (or n if you're using lowercase) some valid outputs are:

NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)

Some invalid outputs are:

NNWNNE
NNE NNW
nnwNNE
NNwNNe

The shortest code in bytes wins.

Given a string that is one of the directions on a 16-point compass rose

16-point compass rose

output the two directions that are immediately adjacent to the input direction, in clockwise order.

Specifically, you need to handle these (and only these) input/output pairs:

Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N

The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately counterclockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.

For example, for input N (or n if you're using lowercase) some valid outputs are:

NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)

Some invalid outputs are:

NNWNNE
NNE NNW
nnwNNE
NNw NNe

The shortest code in bytes wins.

    Tweeted twitter.com/StackCodeGolf/status/852937544773906432
2 clockwise != counterclockwise
source | link

Given a string that is one of the directions on a 16-point compass rose

16-point compass rose

output the two directions that are immediately adjacent to the input direction, in clockwise order.

Specifically, you need to handle these (and only these) input/output pairs:

Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N

The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately clockwisecounterclockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.

For example, for input N (or n if you're using lowercase) some valid outputs are:

NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)

Some invalid outputs are:

NNWNNE
NNE NNW
nnwNNE
NNwNNe

The shortest code in bytes wins.

Given a string that is one of the directions on a 16-point compass rose

16-point compass rose

output the two directions that are immediately adjacent to the input direction, in clockwise order.

Specifically, you need to handle these (and only these) input/output pairs:

Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N

The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately clockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.

For example, for input N (or n if you're using lowercase) some valid outputs are:

NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)

Some invalid outputs are:

NNWNNE
NNE NNW
nnwNNE
NNwNNe

The shortest code in bytes wins.

Given a string that is one of the directions on a 16-point compass rose

16-point compass rose

output the two directions that are immediately adjacent to the input direction, in clockwise order.

Specifically, you need to handle these (and only these) input/output pairs:

Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N

The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately counterclockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.

For example, for input N (or n if you're using lowercase) some valid outputs are:

NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)

Some invalid outputs are:

NNWNNE
NNE NNW
nnwNNE
NNwNNe

The shortest code in bytes wins.

1
source | link

Turn me 22.5 with a rose

Given a string that is one of the directions on a 16-point compass rose

16-point compass rose

output the two directions that are immediately adjacent to the input direction, in clockwise order.

Specifically, you need to handle these (and only these) input/output pairs:

Input  Output
N      NNW NNE
NNE    N NE
NE     NNE ENE
ENE    NE E
E      ENE ESE
ESE    E SE
SE     ESE SSE
SSE    SE S
S      SSE SSW
SSW    S SW
SW     SSW WSW
WSW    SW W
W      WSW WNW
WNW    W NW
NW     WNW NNW
NNW    NW N

The output may be a string with some delimiter (not nothing) between the directions or a two-element list. The direction immediately clockwise to the input must appear first. You may use lowercase letters for the directions instead of uppercase but keep all input and output in one case or the other.

For example, for input N (or n if you're using lowercase) some valid outputs are:

NNW NNE
NNW-NNE
["NNW", "NNE"]
nnw-nne (if using lowercase)

Some invalid outputs are:

NNWNNE
NNE NNW
nnwNNE
NNwNNe

The shortest code in bytes wins.