Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,26 @@
dim chrCnt( 255) ' possible ASCII chars
source$ = "1223334444"
numChar = len(source$)
for i = 1 to len(source$) ' count which chars are used in source
ch$ = mid$(source$,i,1)
if not( instr(chrUsed$, ch$)) then chrUsed$ = chrUsed$ + ch$
j = instr(chrUsed$, ch$)
chrCnt(j) =chrCnt(j) +1
next i
lc = len(chrUsed$)
for i = 1 to lc
odds = chrCnt(i) /numChar
entropy = entropy - (odds * (log(odds) / log(2)))
next i
print " Characters used and times used of each "
for i = 1 to lc
print " '"; mid$(chrUsed$,i,1); "'";chr$(9);chrCnt(i)
next i
print " Entropy of '"; source$; "' is "; entropy; " bits."
end