Day 13 - Part 1

This commit is contained in:
2019-12-13 15:46:23 -05:00
parent 328862ee49
commit 581a342318
5 changed files with 37 additions and 1 deletions

30
Day13/Day13.cs Normal file
View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Advent
{
public static class Day13
{
public static void Execute()
{
var lines = File.ReadAllLines(@".\Day13\input.txt");
var game = new IntcodeComputer(lines[0], 0);
var tiles = new Dictionary<Tuple<long, long>, long>();
while (!game.Halted)
{
var x = game.Execute(0);
var y = game.Execute(0);
var tile = game.Execute(0);
tiles[new Tuple<long, long>(x, y)] = tile;
}
Console.WriteLine(tiles.Values.Count(t => t == 2));
}
}
}

1
Day13/input.txt Normal file

File diff suppressed because one or more lines are too long