Implementerat en tuple-lista
This commit is contained in:
@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static System.Console;
|
||||
|
||||
namespace _2018_06
|
||||
{
|
||||
@ -13,7 +14,21 @@ namespace _2018_06
|
||||
{
|
||||
string[] resTab = File.ReadAllLines(@"..\..\..\Data\Adventofcode_181206\2018_06_data.txt");
|
||||
List<Tuple<int, int>> koords = new List<Tuple<int, int>>();
|
||||
Tuple<int, int> tuple = null;
|
||||
foreach (string v in resTab)
|
||||
{
|
||||
string[] nums = v.Split(new char[] { ',' });
|
||||
tuple = Tuple.Create(int.Parse(nums[0]), int.Parse(nums[1]));
|
||||
koords.Add(tuple);
|
||||
}
|
||||
|
||||
int points = 0;
|
||||
foreach(Tuple<int,int> tp in koords)
|
||||
{
|
||||
points++;
|
||||
WriteLine($"point {points}, X: {tp.Item1} Y: {tp.Item2}");
|
||||
}
|
||||
ReadKey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user