ISBN2 by pooq

do
input""a$
b=len(a$)
if!b end
s=0
j=3
f=b=17
for i=1to b-4j=4-j
if!f j=i
c$=mid$(a$,i+4,1)
if"?"=c$k=j:n=i
s=s+j*(val(c$)+10*c$="X")next
for i=0to 9if!mod(i*k+s,11-f)u=i
next
mid$(a$,n+4)=str$(u)
?a$loop

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

download

return to the top page