diff options
| author | Abigail <abigail@abigail.be> | 2021-10-19 22:02:01 +0200 |
|---|---|---|
| committer | Abigail <abigail@abigail.be> | 2021-10-19 22:02:01 +0200 |
| commit | 3f9069255c9ab3f2a600ce465fa08e2cb2edc57d (patch) | |
| tree | e616e6fad087a1aed1d693542c50acf01e94eeec /challenge-135/abigail/bash | |
| parent | 32ffa2beeb07181afb6af80ebd749bb8629bf636 (diff) | |
| download | perlweeklychallenge-club-3f9069255c9ab3f2a600ce465fa08e2cb2edc57d.tar.gz perlweeklychallenge-club-3f9069255c9ab3f2a600ce465fa08e2cb2edc57d.tar.bz2 perlweeklychallenge-club-3f9069255c9ab3f2a600ce465fa08e2cb2edc57d.zip | |
Might as well map 'A' to 0.
The SEDOL specification says 'A' maps to 10, 'B' to 11, etc.
However, to perform a checksum, all we care about is module 10
arithmetic. So, whether 'A' maps to 10, or to 0, doesn't matter.
Diffstat (limited to 'challenge-135/abigail/bash')
| -rw-r--r-- | challenge-135/abigail/bash/ch-2.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-135/abigail/bash/ch-2.sh b/challenge-135/abigail/bash/ch-2.sh index d79226883a..0cb9fca74f 100644 --- a/challenge-135/abigail/bash/ch-2.sh +++ b/challenge-135/abigail/bash/ch-2.sh @@ -26,7 +26,7 @@ do if ((${#line} != 7)) printf -v ord %d "'$char" if [[ $char =~ [0-9] ]] then ((value = ord - 48)) - else ((value = ord - 65 + 10)) + else ((value = ord - 65)) fi ((check += ${w[i]} * value)) done |
