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 25 optimize and improve heuristics
[aoc_eblake.git]
/
2015
/
advent12.sh
blob
66d7432a0e8b9ddcf7b711d714c252fa574102b0
1
if
[[ !
$part1
]];
then
2
exec
< <(
jq
'delpaths([path(..|select(type=="object" and .[] == "red"))])'
)
3
fi
4
5
sum
=
0
6
for
val
in
$
(
tr
-c
'0-9-'
' '
);
do
7
sum
=
$
((
sum
+
val
))
8
done
9
echo
$sum