Day 13 - Folding like a pro

Right, I've missed about 5 days in a row due to log4j so the explanations are going to be shorter.

We've got a series of fold along instructions. At that point what we're going to have to do is take all the marked dots that are beyond the x or y foldline, and duplicate them below the line.

We're going to use a set of coordinates to indicate each of the (x,y) coords.

When we fold, we'll go through each coordinate and if it's beynd the fold, we create a new coordinate at the equivalent new location. If we hold all the coords in a set (because order doesn't matter), then it will automatically deduplicate the coordinates.

Make sense? Let's describe that with code

Ok, let's try that on test data, remembering that in this case, we only want to apply the first fold instruction

(We're going to need to parse the instructions anyway I suspect)

Ok, that works, lets try on prod data

Part 2 Render the Code

Somewhat as expected, do all the folds and then render