Compare commits
2 commits
57ddd3cb0a
...
0d609a713e
Author | SHA1 | Date | |
---|---|---|---|
0d609a713e | |||
983e4a56a2 |
3 changed files with 11 additions and 2 deletions
9
day1/README.md
Normal file
9
day1/README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# AOC 2023 Day 1 (Shell Script)
|
||||||
|
|
||||||
|
This is a solver for AOC 2023 Day 1 made in Bash
|
||||||
|
|
||||||
|
### Requirements:
|
||||||
|
- Bash
|
||||||
|
|
||||||
|
### Usage:
|
||||||
|
1. Run the script with the input file specified as an argument (ex. `./day1p1.sh input`)
|
|
@ -9,6 +9,6 @@ while read f; do
|
||||||
echo $SUM + $i
|
echo $SUM + $i
|
||||||
SUM=$(( $SUM + $i ))
|
SUM=$(( $SUM + $i ))
|
||||||
done
|
done
|
||||||
done < input
|
done < "$1"
|
||||||
|
|
||||||
echo $SUM
|
echo $SUM
|
||||||
|
|
|
@ -22,6 +22,6 @@ while read f; do
|
||||||
echo $f: $FIRST$LAST
|
echo $f: $FIRST$LAST
|
||||||
SUM=$(( $SUM + $FIRST$LAST ))
|
SUM=$(( $SUM + $FIRST$LAST ))
|
||||||
#sleep 1
|
#sleep 1
|
||||||
done < input
|
done < "$1"
|
||||||
|
|
||||||
echo $SUM
|
echo $SUM
|
||||||
|
|
Loading…
Reference in a new issue