+⍝ count contiguous blocks
+ ⍝ do floodfill with 0s on G starting at ⍵
+ adj←⍵∘+¨(+,-)↓∘.=⍨⍳3 ⍝ adjacent coordinates...
+ adj←(adj∊,⍳⍴G)/adj ⍝ ...which are within the figure...
+ adj←(1=G[adj])/adj ⍝ ...and are marked
+ G[⊂⍵]←0 ⍝ set current position to zero
+ 0=⍴adj:⍬ ⍝ if no adjacent ones, stop
+ ⍝ find coordinates of ones
+ 0=⍴ones:0 ⍝ no ones = no figures
+ ⍝ remove figure starting at first one
+ ⍝ the result is 1 + the amount of figures in the modified array
+⍝ read a block from the interactive input