From eb1d3f08e0bc30090945979dad0e21a22baabce4 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 29 May 2024 10:37:48 +0100 Subject: [PATCH] 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. --- 20/20a.bqn | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 20/20a.bqn 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 -- 2.30.2