CUSIP: Difference between revisions

112 bytes added ,  4 years ago
m
Line 323:
set cs to "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ*&#"
set ns to mapMaybe(elemIndex(cs), s)
script go
on |λ|(f, x)
set fx to |λ|apply(f, x) of mReturn(f)
(fx div 10) + (fx mod 10)
end |λ|
end script
9 = length of ns and item -1 of ns = (10 - (sum(zipWith(go, ¬
cycle({my identity, my double}), ¬
Line 379 ⟶ 381:
{type:"Tuple", |1|:a, |2|:b, length:2}
end Tuple
 
 
-- apply ($) :: (a -> b) -> a -> b
on apply(f, x)
-- The value of f(x)
mReturn(f)'s |λ|(x)
end apply
 
 
9,655

edits