Damm algorithm: Difference between revisions

m
→‎{{header|AppleScript}}: Doubled the speed by replacing the 2-dimensional list with a "referenced" 1-dimensional version.
(Added AppleScript.)
m (→‎{{header|AppleScript}}: Doubled the speed by replacing the 2-dimensional list with a "referenced" 1-dimensional version.)
Line 316:
end repeat
script o
set table to {{0, 3, 1, 7, 5, 9, 8, 6, 4, 2}, ¬
{7,property table : {0, 93, 21, 17, 5, 49, 8, 6, 3}4, 2, ¬
{4, 2 7, 0, 69, 82, 71, 15, 34, 58, 9}6, 3, ¬
{1, 7 4, 52, 0, 96, 8, 37, 41, 23, 6}5, 9, ¬
{6, 1, 27, 35, 0, 49, 58, 93, 74, 8}2, 6, ¬
{3, 6, 71, 42, 23, 0, 94, 5, 89, 1}7, 8, ¬
{5, 8 3, 6, 97, 74, 2, 0, 19, 35, 4}8, 1, ¬
{8, 9, 4, 5, 38, 6, 9, 7, 2, 0, 1, 7}3, 4, ¬
{ 8, 9, 4, 35, 83, 6, 1, 7, 2, 0, 5}1, 7, ¬
{2, 5, 8, 1 9, 4, 3, 8, 6, 1, 7, 92, 0}}, 5, ¬
set table to {{0, 3 2, 15, 78, 51, 94, 83, 6, 47, 2}9, ¬0}
end script
set interim to 0
repeat with d in digits
set interim to item (dinterim +* 1)10 of+ item (interimd + 1) of o's table -- AppleScript indices are 1-based.
end repeat
557

edits