CUSIP: Difference between revisions

Content added Content deleted
Line 2,988: Line 2,988:
=={{header|langur}}==
=={{header|langur}}==
If we don't strictly follow the pseudo-code, we can do this.
If we don't strictly follow the pseudo-code, we can do this.
<syntaxhighlight lang=langur>val .isCusip = f(.s) {
<syntaxhighlight lang=langur>val .isCusip = fn(.s) {
if not isString(.s) or len(.s) != 9 {
if .s is not string or len(.s) != 9 {
return false
return false
}
}
Line 2,999: Line 2,999:
if not .v: return false
if not .v: return false
.v = .v[1]-1
.v = .v[1]-1
if .i div 2: .v x= 2
if .i div 2: .v *= 2
_for += .v \ 10 + .v rem 10
_for += .v \ 10 + .v rem 10
}
}
Line 3,006: Line 3,006:
}
}


val .candidates = w/037833100 17275R102 38259P508 594918104 68389X106 68389X105/
val .candidates = fw/037833100 17275R102 38259P508 594918104 68389X106 68389X105/


for .c in .candidates {
for .c in .candidates {