Browse Source

D15.1 Console print

bastien.monsarrat 6 years ago
parent
commit
f0ddf6ed69
1 changed files with 5 additions and 2 deletions
  1. 5 2
      D15.1/Program.cs

+ 5 - 2
D15.1/Program.cs

@@ -38,7 +38,7 @@ namespace D15._1
         static readonly (int mx, int my)[] MoveSequence = new [] { (0, -1), (-1, 0), (1, 0), (0, 1) };
         static int round = 0;
 
-        static bool PRINT = false;
+        static bool PRINT = true;
 
         static void Main(string[] args)
         {
@@ -68,7 +68,9 @@ namespace D15._1
 
         private static void PrintMap(Map map, List<string> strMap, Units units, int round)
         {
-            if (round > 0) Console.WriteLine($"Playing round {round + 1}");
+            Console.SetCursorPosition(0, 0);
+            if (round > 0) Console.WriteLine($"Playing round {round + 1}    ");
+            else Console.WriteLine($"STARTING SIMULATION");
 
             for (int y = 0; y < strMap.Count; ++y)
             {
@@ -94,6 +96,7 @@ namespace D15._1
 
                 if (ul.Count > 0)
                     Console.Write($"\t{ string.Join(", ", ul.Select(u => $"{ (u is Gob ? 'G' : 'E') }({u.HP})")) }");
+                else for (var i = 0; i < 180; ++i) Console.Write(" ");
 
                 Console.WriteLine();
             }