Skip to main content

27 posts tagged with "C#"

View All Tags

· One min read

This problem had me thinking a little more at the start, especially in how should I determine if a location's area is finite or not. I ended up calculating the areas of each location by going through each possible coordinate in the map and finding the closest location to it, then if a location's area contained a coordinate on the border of the map, that location's area should be infinite.

· 2 min read

First problem with a more complicated input and problem. I solved these by making a class defining a claim (containing the id, position, size) and another class defining the canvas (containing a matrix of claims touching each square inch). The claims are created by parsing each line with a regular expression.