Skip to content

Instantly share code, notes, and snippets.

@isawdrones
Created June 1, 2011 17:48
Show Gist options
  • Save isawdrones/5ab0370262068118a854 to your computer and use it in GitHub Desktop.
Save isawdrones/5ab0370262068118a854 to your computer and use it in GitHub Desktop.
K Random Character Test
vrbs: "!@#$%^&*_-+=:>.<,?~|"
advs: "/\\'",'":"
misc: ";`\"()[]"
int : {x,"-",'x}$:!10
nani: {x,"-",'x}"0",'"nNiI"
num : int,nani
vio : ($!7),'":"
prim: vrbs,advs,misc / verbs + advs + misc
prin: prim,int / verbs + advs + misc + int
prii: prim,num / verbs + advs + misc + int + nan + inf
prio: prii,vio / verbs + advs + misc + int + nan + inf + io
rsct: "_",'"Tadhikmnpstuvw"
rsmn: ("acos";"asin";"atan";"ceil";"ceiling";"cos";"cosh";"exp"
"floor";"log";"sin";"sinh";"sqr";"sqrt";"tan";"tanh";"abs"
"bd";"ci";"db";"dj";"exit";"getenv";"gtime";"ltime";"size")
rsdy: ("bin";"binl";"di";"dot";"draw";"dv";"dvl";"in";"lin";"lsq"
"mul";"setenv";"sm";"ss";"sv";"vs")
rstr: ,"ssr"
resv: rsct,{" _",x," "}'rsmn,rsdy,rstr
all : prio,resv
genr: {("\\"=*a)(1_)/a:,/x@y?#x}
genn: {genr[x]'z#y}
exer: {`0:"executing:\t",x,"\n";r:5:(. x);`0:"result:\t\t",r,"\n"}
exen: {exer'genn[x;y;z]}
while[1;exen[prin;10;1];`0:"\n"]
/ while[1;exen[all;30;1]; `0:\n"]
_exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment