Data update
This commit is contained in:
parent
796d366b97
commit
35bcdeebf8
504 changed files with 7045 additions and 610 deletions
14
Task/Entropy/EasyLang/entropy.easy
Normal file
14
Task/Entropy/EasyLang/entropy.easy
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
func entropy s$ .
|
||||
len d[] 255
|
||||
for c$ in strchars s$
|
||||
d[strcode c$] += 1
|
||||
.
|
||||
for cnt in d[]
|
||||
if cnt > 0
|
||||
prop = cnt / len s$
|
||||
entr -= (prop * logn prop / logn 2)
|
||||
.
|
||||
.
|
||||
return entr
|
||||
.
|
||||
print entropy "1223334444"
|
||||
Loading…
Add table
Add a link
Reference in a new issue