Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
Module hamming_long {
|
||||
function hamming(l as long, &h(),&last()) {
|
||||
l=if(l<1->1&, l)
|
||||
long oldlen=len(h())
|
||||
if oldlen<l then dim h(l) else =h(l-1): exit
|
||||
def long i, j, k, n, m, x2, x3, x5, ll
|
||||
stock last(0) out x2,x3,x5,i,j,k
|
||||
n=oldlen : ll=l-1
|
||||
{ m=x2
|
||||
if m>x3 then m=x3
|
||||
if m>x5 then m=x5
|
||||
h(n)=m
|
||||
if n>=1690 then =h(n):break
|
||||
if m=x2 then i++:x2=2&*h(i)
|
||||
if m=x3 then j++:x3=3&*h(j)
|
||||
if m=x5 then k++:x5=5&*h(k)
|
||||
if n<ll then n++: loop
|
||||
}
|
||||
stock last(0) in x2,x3,x5,i,j,k
|
||||
=h(ll)
|
||||
}
|
||||
dim h(1)=1&, last()
|
||||
def long i
|
||||
const nl$={
|
||||
}
|
||||
document doc$
|
||||
last()=(2&,3&,5&,0&,0&,0&)
|
||||
for i=1 to 20
|
||||
Doc$=format$("{0::-10} {1::-10}", i, hamming(i,&h(), &last()))+nl$
|
||||
next i
|
||||
i=1691
|
||||
Doc$=format$("{0::-10} {1::-10}", i, hamming(i,&h(), &last()))+nl$
|
||||
print #-2,Doc$
|
||||
clipboard Doc$
|
||||
}
|
||||
hamming_long
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
Module hamming {
|
||||
function hamming(l as long, &h(),&last()) {
|
||||
l=if(l<1->1&, l)
|
||||
oldlen=len(h())
|
||||
if oldlen<l then dim h(l) else =h(l-1): exit
|
||||
def decimal i, j, k, m, x2, x3, x5
|
||||
stock last(0) out x2,x3,x5,i,j,k
|
||||
n=oldlen : ll=l-1&
|
||||
{ m=x2
|
||||
if m>x3 then m=x3
|
||||
if m>x5 then m=x5
|
||||
h(n)=m
|
||||
if n>=43207& then =h(n):break
|
||||
if m=x2 then i++:x2=2@*h(i)
|
||||
if m=x3 then j++:x3=3@*h(j)
|
||||
if m=x5 then k++:x5=5@*h(k)
|
||||
if n<ll then n++: loop
|
||||
}
|
||||
stock last(0) in x2,x3,x5,i,j,k
|
||||
=h(ll)
|
||||
}
|
||||
dim h(1)=1@, last()
|
||||
last()=(2@,3@,5@,0@,0@,0@)
|
||||
Document doc$
|
||||
const nl$={
|
||||
}
|
||||
for i=1 to 20
|
||||
Doc$=format$("{0::-10} {1::-28}", i, hamming(i,&h(), &last()))+nl$
|
||||
next i
|
||||
i=1691
|
||||
Doc$=format$("{0::-10} {1::-28}", i, hamming(i,&h(), &last()))+nl$
|
||||
i=9999
|
||||
Doc$=format$("{0::-10} {1::-28}", i, hamming(i,&h(), &last()))+nl$
|
||||
i=43208
|
||||
Doc$=format$("{0::-10} {1::-28}", i, hamming(i,&h(), &last()))+nl$
|
||||
print #-2, Doc$
|
||||
clipboard Doc$
|
||||
}
|
||||
hamming
|
||||
Loading…
Add table
Add a link
Reference in a new issue