Damm algorithm: Difference between revisions
Content deleted Content added
No edit summary |
Drkameleon (talk | contribs) |
||
Line 473:
=={{header|Arturo}}==
<lang rebol>
table: [
[0 3 1 7 5 9 8 6 4 2]
[7 0 9 2 1 5 4 8 6 3]
Line 486 ⟶ 488:
]
; Or, being more explicit:
digits2: function [str][
chars: split str
result: map chars 'ch -> to :integer ch
return result
]
damm2?: function [str][
d: digits2 str
r: fold d .seed: 0 [x y] -> get get table x y
return r = 0
]
test: function [str][
|