Fix usages of nths
parent
10c68ebb21
commit
379566374c
|
@ -39,7 +39,7 @@ PRIVATE>
|
|||
twiddle [ nPk ] keep factorial / ;
|
||||
|
||||
: permutation ( n seq -- seq )
|
||||
tuck permutation-indices nths ;
|
||||
tuck permutation-indices swap nths ;
|
||||
|
||||
: all-permutations ( seq -- seq )
|
||||
[
|
||||
|
|
|
@ -9,7 +9,7 @@ IN: project-euler.186
|
|||
55 [1,b] [ (generator) ] map <circular> ;
|
||||
|
||||
: advance ( lag -- )
|
||||
[ { 0 31 } nths sum 1000000 rem ] keep push-circular ;
|
||||
[ { 0 31 } swap nths sum 1000000 rem ] keep push-circular ;
|
||||
|
||||
: next ( lag -- n )
|
||||
[ first ] [ advance ] bi ;
|
||||
|
|
Loading…
Reference in New Issue