25 lines
660 B
Text
25 lines
660 B
Text
[ [] 26 times [ 0 join ] ] is makecountnest ( --> [ )
|
|
|
|
[ char A char Z 1+ within ] is ischar ( c --> b )
|
|
|
|
[ char A -
|
|
2dup peek 1+ unrot poke ] is tallychar ( [ c --> [ )
|
|
|
|
[ makecountnest swap
|
|
witheach
|
|
[ upper dup ischar iff
|
|
tallychar
|
|
else drop ] ] is countchars ( $ --> [ )
|
|
|
|
[ say "Letter count:" cr
|
|
witheach
|
|
[ say " "
|
|
i^ char A + emit
|
|
say ":" echo
|
|
cr ] ] is echocount ( [ --> )
|
|
|
|
[ sharefile 0 = if
|
|
[ $ " not found."
|
|
join fail ]
|
|
countchars
|
|
echocount ] is fileletters ( $ --> )
|