private void showGamePad(XOSymbol[,] gamePad) { int position = 0; for (int row = 0; row < gamePad.GetLength(0); row++) { for (int column = 0; column < gamePad.GetLength(1); column++) { XOSymbol xoSymbol = (XOSymbol)gamePad.GetValue(row, column); if (xoSymbol != XOSymbol.EMPTY) AddMove(new GameMove(position, xoSymbol)); position++; } } }
private List<int> countEmptyCells(XOSymbol[,] gamePad) { List<int> listEmptyCellsIndex = new List<int>(); int index = 0; for (int row = 0; row < gamePad.GetLength(0); row++) { for (int column = 0; column < gamePad.GetLength(1); column++) { if ((XOSymbol)gamePad.GetValue(row, column) == XOSymbol.EMPTY) { listEmptyCellsIndex.Add(index); } index++; } } return listEmptyCellsIndex; }