commit d80bf49b1568fcee28bddd26f667a5de50943b16
parent d8e9c1709f622035b21e8f41edbd088487bb904d
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date: Sat, 10 Dec 2022 20:25:34 -0800
Just punching things up.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/day_10.jl b/src/day_10.jl
@@ -238,15 +238,15 @@ end
function draw_crt(X::Vector{Int})
@assert length(X) == 6 * 40
- crt = [["." for __ in 1:40] for _ in 1:6]
+ crt = fill(".", (6, 40))
cycle = 1
for row = 1:6, col = 1:40
- (abs(X[cycle]+1 - col) <= 1) && (crt[row][col] = "#")
+ (abs(X[cycle]+1 - col) <= 1) && (crt[row, col] = "#")
cycle += 1
end
- println(join([join(x, "") for x in crt], "\n"))
+ println(reduce((x,y) -> x*"\n"*y, mapslices(join, crt, dims = 2)))
end
function part_2(input)