view day18.txt @ 38:8e92cb172e6b

Output final distance Also minor code cleanup
author IBBoard <dev@ibboard.co.uk>
date Fri, 20 Sep 2024 20:30:11 +0100
parents 6b58ddfaed38
children
line wrap: on
line source

--- Day 18: Lavaduct Lagoon ---

You have a set of instructions - directions, distance and hex colour

R 6 (#70c710)
D 5 (#0dc571)
L 2 (#5713f0)
D 2 (#d2c081)
R 2 (#59c680)
D 2 (#411b91)
L 5 (#8ceee2)
U 2 (#caa173)
L 1 (#1b58a2)
U 2 (#caa171)
R 2 (#7807d2)
U 3 (#a77fa3)
L 2 (#015232)
U 2 (#7a21e3)

This creates a trench:

#######
#.....#
###...#
..#...#
..#...#
###.###
#...#..
##..###
.#....#
.######

This is 38 dug spaces. The inside can then be dug out:

#######
#######
#######
..#####
..#####
#######
#####..
#######
.######
.######

This is now 62 dug spaces.