Last active
May 27, 2021 14:45
-
-
Save LdBeth/237039ad30ae37a8492d5f7d0c6e152b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&anchor = 1 | |
char = len(1) . ch | |
white = span(' ') | |
word = break(' ') white | |
count = table(100) | |
loop line = input :f(stat) | |
lc = lc + 1 | |
copy = line ' ' | |
copy white = | |
skip copy word = :f(nchar) | |
wc = wc + 1 :(skip) | |
nchar line char = :f(loop) | |
ch notany(' ') :f(nchar) | |
chc = chc + 1 | |
count<ch> = count<ch> + 1 | |
n = count<ch> | |
max = lt(max,n) n :f(nchar) | |
maxch = ch :(nchar) | |
:(loop) | |
stat | |
output = 'Line count: ' lc | |
output = 'Max char: ' maxch ', occured ' max | |
output = 'Word count: ' wc | |
output = 'Avg ws: ' (((chc * 10) / wc) / 10.) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment