Extendify the ASCII Sun Write a program that takes in (via STDIN/command line) a non-negative integer N.
When N is 0, your program should print O (that's capital Oh, not zero).
When N is 1, your program should print
\|/
-O-
/|\

When N is 2 your program should print
\ | /
 \|/
--O--
 /|\
/ | \

When N is 3 your program should print
\  |  /
 \ | /
  \|/
---O---
  /|\
 / | \
/  |  \

For larger N, this pattern continues on in the same exact fashion. Each of the eight rays of the &quot;sun&quot; should be made of N of the appropriate -, |, /, or \ characters.
Details

Instead of a program, you may write a function that takes an integer. The function should print the sun design normally or return it as a string.

You must either

have no trailing spaces at all, or
only have enough trailing spaces so the pattern is a perfect (2N+1)*(2N+1) rectangle.


The output for any or all N may optionally have a trailing newline.


Scoring
The shortest code in bytes wins.
C: 116 102 99 95 92 90

s(n){for(int c=-n,r=c;r&lt;=n;c++)putchar(c&gt;n?c=-c,r++,10:c?r?c-r?c+r?32:47:92:45:r?124:79);}


I think that I am getting fairly close to a minimal solution using this approach, but I can't stop feeling that there is a much better approach in C. Ungolfed:

void s(int n) {
  for(
    int c = -n, r = c;
    r &lt;= n;
    c++
  )
    putchar(
      c &gt; n
        ? c = -c, r++, '\n'
        : c
          ? r
            ? c - r
              ? c + r
                ? ' '
                : '/'
              : '\\'
            : '-'
          : r
            ? '|'
            : 'O'
    );
}