June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,25 +1,16 @@
|
|||
integer i, l;
|
||||
record r;
|
||||
real h, x;
|
||||
text s;
|
||||
integer c;
|
||||
real h, v;
|
||||
index x;
|
||||
data s;
|
||||
|
||||
s = argv(1);
|
||||
l = length(s);
|
||||
|
||||
i = l;
|
||||
while (i) {
|
||||
i -= 1;
|
||||
rn_a_integer(r, cut(s, i, 1), 1);
|
||||
for (, c in (s = argv(1))) {
|
||||
x[c] += 1r;
|
||||
}
|
||||
|
||||
h = 0;
|
||||
if (r_first(r, s)) {
|
||||
do {
|
||||
x = r_q_integer(r, s);
|
||||
x /= l;
|
||||
h -= x * log2(x);
|
||||
} while (r_greater(r, s, s));
|
||||
for (, v in x) {
|
||||
v /= ~s;
|
||||
h -= v * log2(v);
|
||||
}
|
||||
|
||||
o_real(6, h);
|
||||
o_newline();
|
||||
o_form("/d6/\n", h);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue