From 7a45a2ff7b9ce535331ad4ad583dae98a596d911 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Sun, 5 Dec 2021 00:02:56 +0200 Subject: [PATCH] Change empty from ' ' to '.' to avoid confusion --- IDAstar.cs | 3 ++- Program.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/IDAstar.cs b/IDAstar.cs index ed66129..e4f74f4 100644 --- a/IDAstar.cs +++ b/IDAstar.cs @@ -20,6 +20,7 @@ namespace IdaStar public static CellState FromInput(this char c) => c switch { '#' => CellState.OBSTACLE, + '.' => CellState.EMPTY, ' ' => CellState.EMPTY, 'S' => CellState.START, 'F' => CellState.DESTINATION, @@ -29,7 +30,7 @@ namespace IdaStar public static char ToInput(this CellState state) => state switch { - CellState.EMPTY => ' ', + CellState.EMPTY => '.', CellState.OBSTACLE => '#', CellState.START => 'S', CellState.DESTINATION => 'F', diff --git a/Program.cs b/Program.cs index b1d20c6..fc859cd 100644 --- a/Program.cs +++ b/Program.cs @@ -49,6 +49,7 @@ static void FormattedLabRow(string line) { break; } + case '.': case ' ': { Console.BackgroundColor = ConsoleColor.Black; Console.Write(" ");