From: Ben Harris Date: Wed, 29 May 2024 09:37:48 +0000 (+0100) Subject: 20a doesn't work X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=eb1d3f08e0bc30090945979dad0e21a22baabce4;p=aoc-2022.git 20a doesn't work It's a pretty solution, but the problem statement has different ideas about what moving an element past the end of the list means. --- diff --git a/20/20a.bqn b/20/20a.bqn new file mode 100644 index 0000000..897c8ce --- /dev/null +++ b/20/20a.bqn @@ -0,0 +1,13 @@ +Prep←•ParseFloat¨ + +Main←{ 𝕊 orig: + •Show orig + cur←orig + JumpFwd←{(1⊸⌽)⌾(((1+|𝕨)⊸↑)∘((⊑𝕩⊐𝕨)⊸⌽)) 𝕩} + Jump←{𝕨≥0 ? 𝕨 JumpFwd 𝕩; ⌽ 𝕨 JumpFwd ⌽𝕩} + { + •Show cur ↩ 𝕩 Jump cur + }¨orig +} + +•Show Main Prep •file.Lines ⊑•args