Word frequency count FIXED by yt

dim d$(999),f(999)
while(z+1)if mod(z,97)<26then
a$=a$+chr$(z)elseif z<33or z=46for i=1to 999if(d$(i)=a$or!f(i))d$(i)=a$:f(i)=f(i)+(a$>""):break
next
a$=""endif
z=or(peek(0),32)wend
i=1:while(f(i))j=i:while(f(j))if(d$(i)>d$(j))t$=d$(i):d$(i)=d$(j):d$(j)=t$:u=f(i):f(i)=f(j):f(j)=u
j=j+1wend
?f(i)," ",d$(i)
i=i+1wend

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page