Пример #1
0
        public override string ToString()
        {
            var stringBuilder = new StringBuilder();

            var numberOfRows = Columns[0].Length;

            for (int row = 0; row < numberOfRows; row++)
            {
                stringBuilder.Append(" |");

                for (var column = 0; column < Columns.Length; column++)
                {
                    var player         = Columns[column][numberOfRows - row - 1];
                    var playerAsString = Connect4Board.FromPlayerToString(player);
                    stringBuilder.Append($"{playerAsString}|");
                }

                stringBuilder.Append("\n");
            }

            return(stringBuilder.ToString());
        }
Пример #2
0
        public override string ToString()
        {
            var playerAsString = Connect4Board.FromPlayerToString(Player);

            return($"Add chip {playerAsString} to column {Column + 1}");
        }