Prep←".#"⊸⊐∘>
-Main←⊢
+# Propose moving north if possible.
+ProposeN←{ ((1≠+´⥊𝕩)∧(0=+´⊏𝕩))/⟨[0‿1‿0,0‿0‿0,0‿0‿0]⟩ }
+
+Propose←{𝕊in: # Given a map of local area, say where Elf in centre will go.
+ ⊑ (∾{𝕏⁼¨ ProposeN 𝕏 in}¨{⌽∘⍉⍟𝕩}¨⟨0,2,3,1⟩) ∾ ⟨[0‿0‿0,0‿1‿0,0‿0‿0]⟩
+}
+
+# Same but propose empty array if there is no Elf.
+ProposeOr←{ (⟨1,1⟩⊑𝕩)∧Propose 𝕩 }
+
+Round←{𝕊map:
+ •Show map
+ ⟨h,w⟩←≢map ⋄ map↩»˘»(2+w)↑˘(2+h)↑map # Pad the map so windows work.
+ ⟨2,3,0,1⟩⍉ProposeOr⎉2⟨3,3⟩↕map
+}
+
+Main←Round⍟1
•Show Main Prep •file.Lines ⊑•args