--- /dev/null
+# We represent an obstacle as a function from time to a map of
+# obstructed squares. BQN supports first-class functions, but the
+# syntax is less confusing if they're wrapped in namespaces.
+
+Blizzards←{𝕊⟨map,fn⟩:
+ # Blizzards get rotated (by Fn) on a torus that doesn't include the
+ # walls.
+ AtTime⇐{ (𝕩⊸Fn) ⌾ ((⟨1,1⟩⊸↓)∘(⟨¯1,¯1⟩⊸↓)) map }
+}
+
+Walls←{𝕊 map:
+ # Walls are boring and ignore the time.
+ AtTime⇐{ 𝕩 ⊢ map }
+}
+
+Prep←{
+ map←>𝕩
+ obstacles⇐⟨
+ Walls '#'=map
+ Blizzards ⟨'^'=map,⌽⟩
+ Blizzards ⟨'v'=map,-⊸⌽⟩
+ Blizzards ⟨'<'=map,⌽˘⟩
+ Blizzards ⟨'>'=map,-⊸⌽˘⟩
+ ⟩
+ start⇐(('.'⊸=)∧∊)⌾⥊map
+ end ⇐(('.'⊸=)∧∊)⌾(⌽∘⥊)map
+}
+
+
+Main←{𝕊⟨obstacles,start,end⟩:
+ Flow←{𝕊⟨t,can_be⟩:
+ (∨´{𝕏can_be}¨⟨«,»,«˘,»˘,⊢⟩) ∧¬(∨´{𝕩.AtTime t}¨obstacles)
+ }
+ ⟨t,·⟩ ← {𝕊⟨t,can_be⟩:⟨t+1,Flow⟨t+1,can_be⟩⟩} •_while_ {𝕊⟨·,can_be⟩:¬∨´⥊can_be∧end} ⟨0,start⟩
+ t
+}
+
+•Show Main Prep •file.Lines ⊑•args