public static void claimSection(Day3Claim newclaim) { for (int y = newclaim.y; y < newclaim.y + newclaim.h; y++) { for (int x = newclaim.x; x < newclaim.x + newclaim.w; x++) { fabric[x, y]++; } } }
public static void parse(string problem) { var words = problem.Split("\r\n"); foreach (string word in words) { Day3Claim newclaim = new Day3Claim(word); width = Math.Max(width, newclaim.w + newclaim.x); height = Math.Max(height, newclaim.h + newclaim.y); claims.Add(newclaim); } }