IBAN: Difference between revisions
m
→{{header|Arturo}}
(Added AppleScript.) |
Drkameleon (talk | contribs) |
||
Line 263:
=={{header|Arturo}}==
<lang
BH: 22, BA: 20, BR: 29, BG: 22, CR: 21, HR: 21, CY: 28
CZ: 24, DK: 18, DO: 28, EE: 20, FO: 18, FI: 18, FR: 27
Line 274:
SK: 24, SI: 19, ES: 24, SE: 24, CH: 21, TN: 24, TR: 26
AE: 23, GB: 22, VG: 24
]
base36:
map 97..122 'x -> upper to :string to :char x
valid?: function [iban][
iban: replace iban " " ""
▲ if [not|contains iban "/[0-9A-Z]+/"] -> return false
]
▲ if [size iban]!=countryIbanSizes.[slice iban 0 1] -> return false
▲ iban: [slice iban 4 [size iban]-1] + [slice iban 0 3]
"GB82 TEST 1234 5698 7654 32"] 'ib
▲ iban: join [map [chars iban] { toString [index base36 &]}] ""
-> print [ib "=> valid?" valid? ib]</lang>
▲ iban: toNumber iban
▲ return iban%97=1
▲loop #("GB82 WEST 1234 5698 7654 32" "GB82 TEST 1234 5698 7654 32") {
{{out}}
<pre>GB82 WEST 1234 5698 7654 32 =>
GB82 TEST 1234 5698 7654 32 =>
=={{header|AutoHotkey}}==
|