From 8a666b244f5002789818bb908911daf4c2050592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Tue, 25 Dec 2018 13:07:44 +0100 Subject: [PATCH 1/2] Extra dock per iteration --- 2018_08/Program.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/2018_08/Program.cs b/2018_08/Program.cs index bd1a5a5..adb07a9 100644 --- a/2018_08/Program.cs +++ b/2018_08/Program.cs @@ -13,7 +13,7 @@ namespace _2018_08 static void Main(string[] args) { string[] resTab = File.ReadAllText(@"..\..\..\Data\Adventofcode_181208\2018_08_data.txt").Split(' '); - //string[] resTab = @"2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2".Split(' '); + //string[] resTab = @"2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2 2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2".Split(' '); int[] numbers = new int[resTab.Length]; for (int i = 0; i < resTab.Length; i++) { @@ -54,8 +54,18 @@ namespace _2018_08 //llT.AddLast(nxt); } } + Write($"start: {strtNode.HeaderStart}, init. end: {strtNode.NodeEnd}, ant. Metas: {strtNode.AntMetaEntries}, "); strtNode.PrepMetatab(headEnd - strtNode.NodeEnd + strtNode.AntMetaEntries); - omgStart= strtNode.NodeEnd; + WriteLine($" fakt. slut {strtNode.NodeEnd}"); + + omgStart = strtNode.NodeEnd; + + for (int i = omgStart; i < omgStart + 5; i++) + { + Write($"numbers[{i}]:{numbers[i]}, "); + } + WriteLine(); + Write(" "); } WriteLine(); From 422616b14d10f171e7439d7b326c0d2a10a5911a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20=C3=96man?= Date: Wed, 26 Dec 2018 01:14:30 +0100 Subject: [PATCH 2/2] lagt till ny egenkonstruerad sekvens --- 2018_07/2018_07.csproj | 2 ++ 2018_08/2018_08.csproj | 2 ++ 2018_08/Program.cs | 18 ++++++++++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/2018_07/2018_07.csproj b/2018_07/2018_07.csproj index bd562e3..6ff6161 100644 --- a/2018_07/2018_07.csproj +++ b/2018_07/2018_07.csproj @@ -35,6 +35,8 @@ + + diff --git a/2018_08/2018_08.csproj b/2018_08/2018_08.csproj index ea796f1..4cdb14a 100644 --- a/2018_08/2018_08.csproj +++ b/2018_08/2018_08.csproj @@ -35,6 +35,8 @@ + + diff --git a/2018_08/Program.cs b/2018_08/Program.cs index adb07a9..3c4c577 100644 --- a/2018_08/Program.cs +++ b/2018_08/Program.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using static System.Console; namespace _2018_08 @@ -12,14 +7,21 @@ namespace _2018_08 { static void Main(string[] args) { - string[] resTab = File.ReadAllText(@"..\..\..\Data\Adventofcode_181208\2018_08_data.txt").Split(' '); + //string[] resTab = File.ReadAllText(@"..\..\..\Data\Adventofcode_181208\2018_08_data.txt").Split(' '); //string[] resTab = @"2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2 2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2".Split(' '); + string[] resTab = @"2 3 2 1 2 3 1 1 0 2 1 2 3 0 3 4 5 6 7 8 9 0 4 10 11 12 13 14 2 2 0 3 15 16 17 0 2 18 19 20 21 22 23 24".Split(' '); int[] numbers = new int[resTab.Length]; for (int i = 0; i < resTab.Length; i++) { numbers[i] = int.Parse(resTab[i]); } - WriteLine($"Antal värden = {resTab.Length}"); + int y = 0; + for(int z = 1; z < 25; z++) + { + y += z; + } + + WriteLine($"Antal värden = {resTab.Length} svar = {y}"); ReadKey(); var pgm = new Program();