chiark
/
gitweb
/
~bjharris
/
aoc-2022.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa00750
)
20a: slight simplification
author
Ben Harris
<bjh21@bjh21.me.uk>
Thu, 30 May 2024 13:38:42 +0000
(14:38 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Thu, 30 May 2024 13:38:42 +0000
(14:38 +0100)
20/20a.bqn
patch
|
blob
|
history
diff --git
a/20/20a.bqn
b/20/20a.bqn
index 44142360d490b815befbbdb2043241d13a930bec..a7686ae7c76684c9e83a1e5a03fbb7f41048098e 100644
(file)
--- a/
20/20a.bqn
+++ b/
20/20a.bqn
@@
-1,10
+1,6
@@
Prep←•ParseFloat¨
Main←{ 𝕊 orig:
- •Show orig
- cur←orig
- #JumpFwd←{(1⊸⌽)⌾(((1+|𝕨)⊸↑)∘((⊑𝕩⊐𝕨)⊸⌽)) 𝕩}
- #Jump←{𝕨≥0 ? 𝕨 JumpFwd 𝕩; ⌽ 𝕨 JumpFwd ⌽𝕩}
Wrap←{1+(𝕨-1)|𝕩-1}
Jump←{
from ← ⊑𝕩⊐𝕨
@@
-12,9
+8,7
@@
Main←{ 𝕊 orig:
len ← to-from
((×len)⊸⌽) ⌾ ((1+|len)⊸↑∘((to⌊from)⊸↓)) 𝕩
}
- {
- •Show cur ↩ 𝕩 Jump cur
- }¨orig
+ cur ← orig Jump´ ⌽orig
+´((≠cur)|(cur⊐0)+⟨1000,2000,3000⟩)⊏cur
}