Exemple #1
0
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            result.AppendFormat("Board {0} \n", this.Size);

            for (int y = this.Size - 1; y >= 0; y--)
            {
                for (int x = 0; x < this.Size; x++)
                {
                    Cell cell = this.GetCellAt(x, y);
                    result.Append(OccupiedHelper.OccupiedToString(cell.IsOccupied));
                    if (x < (this.Size - 1))
                    {
                        result.Append("  ");
                    }
                }

                result.Append("\n");
            }

            return(result.ToString());
        }
Exemple #2
0
 public override string ToString()
 {
     return(this.location + " " + OccupiedHelper.OccupiedToString(this.IsOccupied));
 }