Jump to content

ISBN13 check digit: Difference between revisions

(for clarity, replaced ISBN for opCode with ISBN for Python Interviews (which I have no vested interest in))
Line 1,945:
<syntaxhighlight lang="langur">val .isbn13checkdigit = f(var .s) {
.s = replace(.s, RE/[\- ]/)
matching(.s -> re/^[0-9]{13}$/, .s) and
fold(f{+}, map [_, f{x 3}], s2n .s) div 10
}
990

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.