Skip to content

Commit b844c7d

Browse files
committed
[Day 17] Tiny change
1 parent 9acab74 commit b844c7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/day17.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ function day17(input::String = readInput(joinpath(@__DIR__, "..", "data", "day17
1212
p2 = 0
1313
for elem sequence
1414
p2 += elem
15-
p2 *= 8
15+
p2 <<= 3
1616
end
17-
p2 ÷= 8
17+
p2 >>= 3
1818

1919
return [p1, p2]
2020
end
@@ -37,7 +37,7 @@ function find_sequence(registers, instructions)
3737
if out[1] == instructions[end - depth + 1]
3838
push!(sequence, value)
3939
old_current = current_value
40-
current_value = new_current * 8
40+
current_value = new_current << 3
4141
if try_next_value(depth + 1)
4242
return true
4343
end

0 commit comments

Comments
 (0)