Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
8
Task/CUSIP/Zkl/cusip-1.zkl
Normal file
8
Task/CUSIP/Zkl/cusip-1.zkl
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fcn cusipCheckDigit(cusip){
|
||||
var [const] vs=[0..9].chain(["A".."Z"],T("*","@","#")).pump(String);
|
||||
try{
|
||||
sum:=Walker.cycle(1,2).zipWith(fcn(n,c){ v:=vs.index(c)*n; v/10 + v%10 },
|
||||
cusip[0,8]).reduce('+);
|
||||
((10 - sum%10)%10 == cusip[8].toInt()) and cusip.len()==9
|
||||
}catch{ False }
|
||||
}
|
||||
4
Task/CUSIP/Zkl/cusip-2.zkl
Normal file
4
Task/CUSIP/Zkl/cusip-2.zkl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
foreach cusip in (T("037833100", "17275R102",
|
||||
"38259P508", "594918104", "68389X106", "68389X105")){
|
||||
println(cusip,": ",cusipCheckDigit(cusip));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue