diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/fifty.bqn | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/fifty.bqn b/examples/fifty.bqn index 34222304..db5bb4a5 100644 --- a/examples/fifty.bqn +++ b/examples/fifty.bqn @@ -98,7 +98,7 @@ Permutations ← {𝕊0:1‿0⥊0; ∾<˘(0∾˘1+𝕊𝕩-1)⊏⎉2‿1⍒˘= ! (6‿3⥊0‿1‿2‿0‿2‿1‿1‿0‿2‿1‿2‿0‿2‿0‿1‿2‿1‿0)≡Permutations 3 # 20 -InversePermutation ← ⍋ #Alternatively: ⊐⟜(↕≠) +InversePermutation ← ⍋ #Alternatively: ⊐⟜(↕≠) ! (↕10)≡InversePermutation⊸⊏1‿4‿5‿2‿6‿8‿3‿7‿0‿9 # 21 @@ -124,10 +124,10 @@ IndexFromCombination‿CombinationFromIndex ← { Ic ← {m‿n←𝕨 ⋄ ⊑-˝(m-↕m) +˝∘(C˘) n-(»1+𝕩)∾˘𝕩} Ci ← { 0‿i𝕊𝕩: ⟨⟩; - m‿n←𝕨 - v←⥊+`(m-1)C(1-m)↓⌽↕n - k←(v>𝕩)⊐1 - k∾(1+k)+(𝕨-1∾1+k)𝕊(𝕩-k⊏0∾v) + m‿n←𝕨 + v←⥊+`(m-1)C(1-m)↓⌽↕n + k←(v>𝕩)⊐1 + k∾(1+k)+(𝕨-1∾1+k)𝕊(𝕩-k⊏0∾v) } Ic‿Ci } |
