repo.or.cz
/
aoc_eblake.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
day 24 optimize
[aoc_eblake.git]
/
2018
/
day5a.sh
blob
410d00618d063dc01c5cd7108ec3d475b64936ec
1
read
line
<
${1-/dev/null}
2
printf
"Starting with %d characters
\n
"
${#line}
3
adj
=
$line
4
line
+=
aA
5
while
[[
$line
!=
$adj
]];
do
6
line
=
$adj
7
for
l
in
{
a..z
};
do
8
eval
adj
=
\
${adj//$l${l^}
}
9
eval
adj
=
\
${adj//${l^}$l}
10
done
11
done
12
printf
"Ended with %d characters
\n
"
${#line}