private static Checker[,] GenerateBoardToPrint() { var boardToPrint = new Checker[32, 12]; GenerateUpperBoard(ref boardToPrint); GenerateLowerBoard(ref boardToPrint); return boardToPrint; }
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++; } }
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++; } }