diff options
author | Ben Harris <ben@tilde.team> | 2020-12-02 02:08:11 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-12-02 02:08:11 -0500 |
commit | 3111405d8c846186d5c4df3bc3189b5933cca956 (patch) | |
tree | 2acca575c2ffa66c485980674dc99d68c7db95bf /Day13.cs | |
parent | ffcada8a24bc8d2ae1a7ac7226196789aba42879 (diff) |
use tuple deconstruction
Diffstat (limited to 'Day13.cs')
-rw-r--r-- | Day13.cs | 7 |
1 files 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 }); } } |