#Dyalog APL, 34 bytes
'- |'[2+∘.(≤-(1+=)×ばつ2|⌈)⍨(⌽,0,⊢)⍳⎕]
Right to left:
⍳⎕ is 1 2 ... N
(⌽,0,⊢) is a train that turns it into -N ... -1 0 1 ... N
∘.( )⍨ executes the parentheses for every pair of coordinates ⍺ ⍵
the train (≤-(1+=)×ばつ2|⌈) or its dfn equivalent {(⍺≤⍵)-(1+⍺=⍵)×ばつ2|⍺⌈⍵} produces a matrix like:
̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1
0 1 0 0 0 0 0 0 0 1 0
0 1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 1 0
0 1 0 1 0 0 0 1 0 1 0
0 1 0 1 ̄1 ̄1 ̄1 1 0 1 0
0 1 0 1 0 1 0 1 0 1 0
0 1 0 1 ̄1 ̄1 ̄1 1 0 1 0
0 1 0 1 0 0 0 1 0 1 0
0 1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 1 0
0 1 0 0 0 0 0 0 0 1 0
̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1 ̄1
'- |'[2+ ] makes these valid indices in ⎕IO=1 and picks the corresponding characters
ngn
- 15.6k
- 2
- 45
- 90