Example #1
0
 /// <summary>
 /// Prints the fleet of ships.  For each ship print the
 /// ship itself (using ToString()) on one line followed by
 /// all the ships coordinates on a second line.
 /// </summary>
 public void Print()
 {
     for (int i = 0; i < Ships.Count; ++i)
     {
         Ship Ship = Ships.ElementAt(i);
         Console.WriteLine(Ship);
         Console.Write("\t");
         for (int j = 0; j < Ship.Length; ++j)
         {
             Console.Write(Ship.GetPosition(j));
         }
         Console.WriteLine();
     }
 }