From 024c45e5cd8bb0c669c18f8e959c74441ebb1923 Mon Sep 17 00:00:00 2001 From: Dan Cojocaru Date: Sat, 4 Dec 2021 14:32:56 +0200 Subject: [PATCH] Do not clear screen if showing only final result --- Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Program.cs b/Program.cs index 7214258..cc4940a 100644 --- a/Program.cs +++ b/Program.cs @@ -37,7 +37,7 @@ if(printSteps) { } algoBoard.RunIdaStar(); -PrintBoard(0, true); +PrintBoard(0, true, clearScreen: printSteps); static void FormattedLabRow(string line) { char[] characters = line.ToCharArray(); @@ -108,8 +108,8 @@ string[] FormatLabyrinth(string[] labIN) { return FormattedLabyrinth; } -void PrintBoard(int threshold, bool done){ - Console.Clear(); +void PrintBoard(int threshold, bool done, bool clearScreen = true){ + if (clearScreen) Console.Clear(); step++; if(done){ Console.WriteLine("The solved labyrinth is:");