« first day (1114 days earlier)      last day (421 days later) » 

09:26
9 +
Sorry, please disregard the previous message
10:24
Consider it disregarded
Never saw it.
What are y'all replying to? I can't see. :P
 
5 hours later…
15:59
how do i generate all permutations?
in ngn/k
like oK's prm
You could steal ok's prm from github.com/JohnEarnest/ok/blob/…
i guess i can...but is it golfy?
@copy i get a type error ?
prm 1 0 1 0
'type
 {{$[x;,/x,''o'x^/:x;,x]}@$[-8>@x;!x;x]}
                              ^
 prm 1 0 1 0
     ^
16:43
No idea, sorry
17:24
@PyGamer0 there's some functions in l/maths.k
 
3 hours later…
20:20
The one I find easy to remember is to iterate by putting the length of a permutation of the previous iteration in front of all the previous iterations and then rotate it through.
rot:{1_x,1#x}
prm:{x{,/l rot\'x,\:l:#*x}/,!0}
^in front of^after. It doesn’t really matter but after avoid parens.
Oh, wait. This lists all permutations of a given length. Is that what you’re trying to do? I’m not clear what you expect of prm 1 0 1 0.
20:53
@PyGamer0 the last part of the program checks the type of the argument with @. the type error in ngn/k happens because the results from @ are symbols in this implementation. you could write it as {{$[x;,/x,''o'x^/:x;,x]}@$[`I<@x;!x;x]}
of course you can golf it more if you don't want to support both list and atom inputs

« first day (1114 days earlier)      last day (421 days later) »