コード例 #1
0
        private static Checker[,] GenerateBoardToPrint()
        {
            var boardToPrint = new Checker[32, 12];

            GenerateUpperBoard(ref boardToPrint);
            GenerateLowerBoard(ref boardToPrint);
            return boardToPrint;
        }
コード例 #2
0
 private static void GenerateUpperBoard(ref Checker[,] boardToPrint)
 {
     var pointIndex = 13;
     var yPosition = 0;
     while (pointIndex <= 24)
     {
         if (_board[pointIndex] == null)
         {
             yPosition++;
             pointIndex++;
             continue;
         }
         var xPosition = 0;
         foreach (var checker in _board[pointIndex])
         {
             boardToPrint[xPosition, yPosition] = checker;
             xPosition++;
         }
         yPosition++;
         pointIndex++;
     }
 }
コード例 #3
0
 private static void GenerateLowerBoard(ref Checker[,] boardToPrint)
 {
     var pointIndex = 1;
     var yPosition = 11;
     while (pointIndex <= 12)
     {
         if (_board[pointIndex] == null)
         {
             yPosition--;
             pointIndex++;
             continue;
         }
         var xPosition = 31;
         foreach (var checker in _board[pointIndex])
         {
             boardToPrint[xPosition, yPosition] = checker;
             xPosition--;
         }
         yPosition--;
         pointIndex++;
     }
 }