You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
889 B

#!k
r:("// ngn/k, (c) 2019-2021 ngn, license: GNU AGPLv3 - https://codeberg.org/ngn/k/blob/master/LICENSE"
"// generated by g.k")
R:,/{$[x~"@";*y;x~"$";y 1;x~"%";_*y;x]}\:;d:{r,:"#define ",/:x[0]R/:+a@'!#'a:1_x;}
v:"xyzu";t:"ABHILDC";T:t,"SMmildscopqruvwe";U:T,"FPRtTzZ",$`cC`lL`dD`sS`zZ`mM`mt`MT`zd`ZD`zc`ZC`zdc`ZDC`mMA`sSA
/@:arg[0],$:arg[1],%:lower(arg[0])
d("@$ _$(@)";v;"KkmNnoRrtUVvWwXxyZz",t,(_t),"t",'U)
d("@$(a...) _$(@,a)";v;"qe128")
d("@$(a...) P(%t$,a)";"XY";U)
d("@(a) dex(@,a)";v)
d("_@(x) ((@*)_V(x))";t)
d("_%(x) _@(x)[i]";t)
d("_t@(x) (_t(x)==t@)";"ABHILDCSMmldopqr")
d("_t@(x) (_t0(x)==t@)";"iscuvwe")
d("N@(r) N(r,@(0))";v)
d("o@ _R(ce[t@])";"ABLDCS")
d'(,"@$ @ $"),/:":"\'" "\"C:bcdt ILN:ijkmn CBHILD:v I:f A:xyzu O:ACV Q:spq";
r,:{"#define _",x,"(x) ((A*)_V(x))[",y,"]"}'["xyz";"012"]
r,:{"#define _t",x,"(x) (_t",(-1_x),"(x)||_t",(-1#x),"(x))"}'(1<#:')#U
"g.h"0:r