From b539661727c4959cbab7afdfc937353e9cd12f42 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 1 Jun 2024 12:12:27 +0100 Subject: [PATCH] 22a: initial position and a debug display --- 22/22a.bqn | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/22/22a.bqn b/22/22a.bqn index cc04f7b..32abbe8 100644 --- a/22/22a.bqn +++ b/22/22a.bqn @@ -3,4 +3,13 @@ PrepStep←{ 𝕊"L": 'L'; 𝕊"R": 'R'; •ParseFloat 𝕩 } PrepPath←{ PrepStep¨(+`⟨0⟩∾≠˝⍉2↕𝕩∊"LR")⊔𝕩 } Prep←{ ⟨ PrepMap ¯2↓𝕩, PrepPath ¯1⊑𝕩 ⟩ } -•Show Prep •file.Lines ⊑•args +Mark←{map𝕊⟨pos,dir⟩: + ({𝕊⟨0,1⟩:'>';𝕊⟨1,0⟩:'v';𝕊⟨0,¯1⟩:'<';𝕊⟨¯1,0⟩:'^'}dir)⌾(pos⊸⊑) map +} +Main←{𝕊⟨map,path⟩: + pos←⟨0,⊑(⊏map)⊐'.'⟩ + dir←⟨0,1⟩ + map Mark⟨pos,dir⟩ +} + +•Show Main Prep •file.Lines ⊑•args -- 2.30.2