Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/ISBN13-check-digit/PicoLisp/isbn13-check-digit.l
Normal file
20
Task/ISBN13-check-digit/PicoLisp/isbn13-check-digit.l
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
(de isbn13? (S)
|
||||
(let L
|
||||
(make
|
||||
(for N (chop S)
|
||||
(and (format N) (link @)) ) )
|
||||
(and
|
||||
(= 13 (length L))
|
||||
(=0 (% (sum * L (circ 1 3)) 10)) ) ) )
|
||||
(mapc
|
||||
'((A)
|
||||
(tab
|
||||
(-19 1)
|
||||
A
|
||||
(if (isbn13? A) 'ok 'fail) ) )
|
||||
(quote
|
||||
"978-1734314502"
|
||||
"978-1734314509"
|
||||
"978-1-86197-876-9"
|
||||
"978-2-74839-908-5"
|
||||
"978 1 86197 876 9" ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue