Exemplo n.º 1
0
        /// <summary>
        /// Returns string with text representations of all history boards from left to right.
        /// </summary>
        /// <returns></returns>
        public string BoardPictures()
        {
            string[] rows = new string[] { "", "", "", "", "", "", "", "", "", "" };

            for (int i = 0; i < EncodedPositionBoards.NUM_MOVES_HISTORY; i++)
            {
                EncodedPositionBoard planes = GetPlanesForHistoryBoard(i);
                string   lines  = planes.GetBoardPicture(true);
                string[] parsed = lines.Split('\n');


                for (int line = 0; line < parsed.Length; line++)
                {
                    rows[line] += parsed[line] + "  ";
                }
            }

            // Concatenate the lines across all boards
            StringBuilder allLines = new StringBuilder();

            for (int i = 0; i < rows.Length; i++)
            {
                allLines.AppendLine(rows[i]);
            }

            return(allLines.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns string with text representations of a specified history board.
        /// </summary>
        /// <param name="historyIndex"></param>
        /// <returns></returns>
        public string BoardPictureForHistoryBoard(int historyIndex)
        {
            EncodedPositionBoard planes = GetPlanesForHistoryBoard(historyIndex);

            return(planes.GetBoardPicture(true));
        }