Skip to content

Commit 1aeb5d2

Browse files
committed
Fuck this
1 parent e45e26a commit 1aeb5d2

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

day09.sh

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ cat $CHALLENGE/input_test_01.txt | bin/$CHALLENGE debug
99

1010
echo "Solution"
1111
cat $CHALLENGE/input.txt | bin/$CHALLENGE
12+

day09/main.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ func main() {
2828
panic(err)
2929
}
3030

31-
positionVisitedByTail, err := MoveRope(ioutil.NopCloser(bytes.NewBuffer(rawBody)), (len(os.Args) >= 2 && os.Args[1] == "debug"), 1)
31+
debug := (len(os.Args) >= 2 && os.Args[1] == "debug")
32+
33+
positionVisitedByTail, err := MoveRope(ioutil.NopCloser(bytes.NewBuffer(rawBody)), debug, 1)
3234
if err != nil {
3335
log.Fatal(err)
3436
}
3537

3638
fmt.Printf("Part 1: %d\n", positionVisitedByTail)
3739

38-
x, err := MoveRope(ioutil.NopCloser(bytes.NewBuffer(rawBody)), (len(os.Args) >= 2 && os.Args[1] == "debug"), 9)
40+
x, err := MoveRope(ioutil.NopCloser(bytes.NewBuffer(rawBody)), debug, 9)
3941
if err != nil {
4042
log.Fatal(err)
4143
}

0 commit comments

Comments
 (0)