Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Knuths-algorithm-S/J/knuths-algorithm-s-1.j
Normal file
24
Task/Knuths-algorithm-S/J/knuths-algorithm-s-1.j
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
s_of_n_creator=: 1 :0
|
||||
ctx=: conew&'inefficient' m
|
||||
s_of_n__ctx
|
||||
)
|
||||
|
||||
coclass'inefficient'
|
||||
create=:3 :0
|
||||
N=: y
|
||||
ITEMS=: ''
|
||||
K=:0
|
||||
)
|
||||
|
||||
s_of_n=:3 :0
|
||||
K=: K+1
|
||||
if. N>:#ITEMS do.
|
||||
ITEMS=: ITEMS,y
|
||||
else.
|
||||
if. (N%K)>?0 do.
|
||||
ITEMS=: ((<<<?N){ITEMS),y
|
||||
else.
|
||||
ITEMS
|
||||
end.
|
||||
end.
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue