ISBN13 check digit: Difference between revisions

Content deleted Content added
Langurmonkey (talk | contribs)
→‎{{header|langur}}: using operator implied function
Langurmonkey (talk | contribs)
Line 187:
 
=={{header|langur}}==
{{works with|langur|0.6.613}}
<lang langur>val .isbn13checkdigit = f(.n) {
val .s = replace( .n, RE/[\- ]/, ZLS)
if not matching(re/^[0-9]{13}$/, .s) {
return false
Line 196:
val .nums = map(
f(.i, .d) if(.i rem 2 == 0: .d x 3; .d),
series 1..13,
map f .c-'0', s2cp .s,
)