ISBN13 check digit: Difference between revisions

Content added Content deleted
Line 1,966: Line 1,966:
.s = replace(.s, RE/[\- ]/)
.s = replace(.s, RE/[\- ]/)
var .alt = true
var .alt = true
matching(re/^[0-9]{13}$/, .s) and
.s -> re/^[0-9]{13}$/ and
for[=0] .d in s2n(.s) { _for += if(not= .alt: .d x 3; .d) } div 10
for[=0] .d in s2n(.s) { _for += if(not= .alt: .d x 3; .d) } div 10
}
}