4 ms·
I still use k2 in addition to k4. Being able to see which things change and which stay the same between versions helps in the slow, thorough type of learning pr
by feelin_googley 9y ago
I still use k2 in addition to k4. Being able to see which things change and which stay the same between versions helps in the slow, thorough type of learning process. (I am not a fast learner. I am a thorough learner.) I would love to get a copy of k5 or greater but I am not a programmer by trade and doubt I would pass the audition.
Although I stopped using Windows, X11 and Mac a long time ago, I have tried k2 on Windows and it is extremley fast, irrespective of whether the computer is old and "underpowered". I used it to instantaneously generate plots and charts from the command line, instead of driving Excel with some scripting language. This is software from the late 1990s early 2000s.
RosettaCode wiki needs to fix its k entries or turn off the silly Cloudflare email protection or whatever is causing the problem. The "@" symbol and subsequent characters are being replaced by "[email protected]".
https://rosettcode.org/wiki/Category:K https://rosettcode.org/wiki/Category:K
k4 can be integrated into daily use in UNIX-like OS for text processing.
Professional example: https://github.com/adavies42/qist/blob/master/lib/awq.k https://github.com/adavies42/qist/blob/master/lib/awq.k
Amateur example: (remove all duplicate lines)
AWK
#!/bin/sh
awk '!a[$0]++' < $1 > $1.tmp;
exec mv -v $1.tmp $1;
k4
#!/bin/sh
exec echo "k).Q.fs[l:0::\`:$1];l:?:l;\`:$1 0:l"|exec q >&2;
Experiment: keep increasing the size of the file passed as $1 until the AWK version fails.