tasks a-s

This commit is contained in:
Ingy döt Net 2013-04-10 23:57:08 -07:00
parent 47bf37c096
commit b83f433714
12433 changed files with 156208 additions and 123 deletions

View file

@ -0,0 +1,8 @@
#import std
#import nat
alphabet = digits-- ~=`A-~r letters
weights = <1,3,1,7,3,9>
charval = -:@rlXS num alphabet
iprod = sum:-0+ product*p/weights+ charval*
checksum = difference/10+ remainder\10+ iprod

View file

@ -0,0 +1,2 @@
weights = difference/*10 <1,3,1,7,3,9>
checksum = remainder\10+ iprod

View file

@ -0,0 +1,2 @@
lookup = -: (^/~& product^|/~& charval)*lsPrK0/weights alphabet
iprod = sum:-0+ lookup*p/weights

View file

@ -0,0 +1,2 @@
lookups = (-:+ * ^/~&l product^|/charval ~&)* *-* -*weights alphabet
iprod = sum:-0+ gang +^|(~&,~)*lNrXXK9 ^(~&,&h!)* lookups

View file

@ -0,0 +1,15 @@
#show+
examples = ^T(~&,~&h+ %nP+ checksum)*t
-[
710889
B0YBKJ
406566
B0YBLH
228276
B0YBKL
557910
B0YBKR
585284
B0YBKT]-