Post History
APL(Dyalog Unicode), 64 bytes SBCS {64-≢∪x,u/⍨∧/¨(>∘0∧<∘9)u←⊃,/(a/⍨2|+/¨|a←,∘.,⍨1 2,-1 2)∘+∘⊂¨x←⍸⍵} Try it on APLgolf! A dfn which takes a boolean grid.
Answer
#1: Initial revision
# [APL(Dyalog Unicode)][1], <sup><s></s></sup>64 bytes <sup>[SBCS][2]</sup> ``` {64-≢∪x,u/⍨∧/¨(>∘0∧<∘9)u←⊃,/(a/⍨2|+/¨|a←,∘.,⍨1 2,-1 2)∘+∘⊂¨x←⍸⍵} ``` [Try it on APLgolf!](https://razetime.github.io/APLgolf/?h=AwA&c=qzYz0X3UuehRx6oKnVL9R70rHnUs1z@0QsPuUccMAyDbBkhbapY@apvwqKtZR18jEaTGqEYbqKYmESiqA5TX0wGKGSoY6egCCU2ggDYQP@pqOrSiAqSvd8ej3q21AA&f=tZUxcsIwEEX7nEJD42SHwiRgkiIXSPEpKBkKKMIhMukYZjKZZKDIAXKIXEgniaxIZmV7sYiFGr6X1T5rvbva6N3@5Xql1jdG6M@vp/kMSn/86PftWr99P6sM2aPeHVavVxuVLRYDcmswVDUNwX5Kw2p4@3KoxtNl5lAwf8Ms625@yek/1WJn/nBL1AY1qkjJo4uks3baNyBuP74BoWnvRarrksyiU@VD7SRiO1lEYjt7Z48CD5YZ6nfWzuzZz@BL1Z@1WTWV3XqJVWNIt90kFhECKfTvzJ7cigjsaG9pnGppQ7orYlBSGERPj3JK3Eeg/jOQmqjJREAlCF9HTaMSeJaGgHpIj6prCCikR7lTFTm7PC50Ko8aBSjwfAf9A17gxxkS6192cBFeid7FPVRjpq/doPJk10fXqM0vX3/@S40N6hc&i=AwA&r=tryapl&l=apl-dyalog&m=dfn&n=f) [1]: https://dyalog.com [2]: https://github.com/abrudz/SBCS A dfn which takes a boolean grid.