mirror of
https://github.com/ckaczor/Advent2019.git
synced 2026-01-13 17:22:15 -05:00
Day 13 - Part 1
This commit is contained in:
@@ -13,6 +13,9 @@
|
||||
<None Update="Day10\input.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Day13\input.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Day1\input.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=day10/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=day11/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=day12/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=day13/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=day2/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=day3/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=day4/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
30
Day13/Day13.cs
Normal file
30
Day13/Day13.cs
Normal 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
1
Day13/input.txt
Normal file
File diff suppressed because one or more lines are too long
@@ -15,7 +15,8 @@
|
||||
//Day9.Execute();
|
||||
//Day10.Execute();
|
||||
//Day11.Execute();
|
||||
Day12.Execute();
|
||||
//Day12.Execute();
|
||||
Day13.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user