Skip to content

Instantly share code, notes, and snippets.

@llelf
Last active May 9, 2022 11:50
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save llelf/fe5363941898c302a6967bd6028c6f10 to your computer and use it in GitHub Desktop.
Save llelf/fe5363941898c302a6967bd6028c6f10 to your computer and use it in GitHub Desktop.
what k4/k7 k9 example result
---------------------------------------------------------------------------------
each-left a f\:b a f\:b (!3)*\:!2 (0 0;0 1;0 2)
each-right a f/:b a f/:b (!3)*/:!2 (0 0 0;0 1 2)
fold f/v f/v */6 7 42
fold w/initial a f/v a f/v 7*/11 13 1001
scan f\v f\v -\1 1 1 1 0 -1
scan w/initial a f\v a f\v 3-\1 1 1 2 1 0
fixpoint f/x f/:x (1+1%)/:1 1.618034
fixpoint scan f\x f\:x 3 4 2 1\:0 0 3 1 4
do-n n f/x (n;f)/:x (2;"ha",)/:"!" "haha!"
do-n scan n f\x (n;f)\:x (3;{x*x})\:2 2 4 16 256
while c f/x (c;f)/:x (1e3>;2*)/:1 1024
while scan c f\x (c;f)\:x (5 mod;2+)\:4 4 6 8 10
e.g. flatten ,// ,//: ,//:((1;2 3);4) 1 2 3 4
sv b/:v b/v 16/2 10 42
vs b\:x b\x 2\42 1 0 1 0 1 0
@llelf
Copy link
Author

llelf commented May 21, 2020

   i:&'3={y*1+x}\'" "=b:2_(#')#0:"folds.txt";&/(~/$.')'(i^'b)[;3 4]

@ktye
Copy link

ktye commented Sep 28, 2020

flatten could use a better example. if you do k9 ,// the result is the same (no fixed-point involved).
how about: ,//:((1;2 3);4)

@llelf
Copy link
Author

llelf commented Oct 12, 2020

@ktye yes! thanks

@anujgoyal
Copy link

mi 2021.09.20 2 16 (c)shakti 2.0
 (3;{x*x})\:2
OS
!nyi
 (1e3>;2*)/:1
!type
 (5 mod;2+)\:4
OS
!nyi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment