From 3111405d8c846186d5c4df3bc3189b5933cca956 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 2 Dec 2020 02:08:11 -0500 Subject: [PATCH] use tuple deconstruction --- Day13.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Day13.cs b/Day13.cs index 47476e5..681126d 100644 --- a/Day13.cs +++ b/Day13.cs @@ -38,19 +38,18 @@ namespace aoc2019 private void PrintBoard() { - foreach (var tile in board) + foreach (var ((x, y), value) in board) { - var (x, y) = tile.Key; if (x < 0 || y < 0) continue; Console.SetCursorPosition(x, y); - Console.Write(tile.Value switch + Console.Write(value switch { 0 => " ", 1 => "|", 2 => "B", 3 => "_", 4 => ".", - _ => tile.Value + _ => value }); } }