Code←{
Count←⊢+.≠(⊃0⍴⊂) ⍝ number of non-empties
Of←{
Axes←⍳=∘⊂∘⌈÷∘2 ⍝ middle coordinates
mask←,⍺⍺/¨Axes⍴⍵
mask/,⍵
}
m←Count⊢M←,⍵ ⍝ Moore with self
s←Count⊢S←∧Of ⍵ ⍝ Self
e←Count⊢E←⍲Of ⍵ ⍝ moorE without self
v←Count⊢V←∨Of ⍵ ⍝ Von neumann with self
n←Count⊢N←≠Of ⍵ ⍝ von neumanN without self
p←Count⊢P←0≠⍺ ⍝ Padded
}n