2 deleted 2 characters in body
source | link

c, 222 216216 211 bytes

main(c,v)char**v;{char r[]="N|NNE|NE|ENE|E|ESE|SE|SSE|S|SSW|SW|WSW|W|WNW|NW|NNW|"r[]="NXNNEXNEXENEXEXESEXSEXSSEXSXSSWXSWXWSWXWXWNWXNWXNNWX",*p=r,*s=r,*a[16],i=0,n;for(;*p++;)if(*p==124)*p==88?*p=0,n=strcmp(a[i++]=s,v[1])?n:i-1,s=++p;printfs=++p:0;printf("%s %s\n",a[n?n-1:15],a[n<15?n+1:0]);}

Try it onlineTry it online

c, 222 216 bytes

main(c,v)char**v;{char r[]="N|NNE|NE|ENE|E|ESE|SE|SSE|S|SSW|SW|WSW|W|WNW|NW|NNW|",*p=r,*s=r,*a[16],i=0,n;for(;*p++;)if(*p==124)*p=0,n=strcmp(a[i++]=s,v[1])?n:i-1,s=++p;printf("%s %s\n",a[n?n-1:15],a[n<15?n+1:0]);}

Try it online

c, 222 216 211 bytes

main(c,v)char**v;{char r[]="NXNNEXNEXENEXEXESEXSEXSSEXSXSSWXSWXWSWXWXWNWXNWXNNWX",*p=r,*s=r,*a[16],i=0,n;for(;*p++;)*p==88?*p=0,n=strcmp(a[i++]=s,v[1])?n:i-1,s=++p:0;printf("%s %s\n",a[n?n-1:15],a[n<15?n+1:0]);}

Try it online

1
source | link

c, 222 216 bytes

main(c,v)char**v;{char r[]="N|NNE|NE|ENE|E|ESE|SE|SSE|S|SSW|SW|WSW|W|WNW|NW|NNW|",*p=r,*s=r,*a[16],i=0,n;for(;*p++;)if(*p==124)*p=0,n=strcmp(a[i++]=s,v[1])?n:i-1,s=++p;printf("%s %s\n",a[n?n-1:15],a[n<15?n+1:0]);}

Try it online