Generation

generate functionMon, 14 Nov 2022

char[,] grid = new char[3,3]; internal void Move(int position, char player)

public void Move(int position, char player) { var grid = new char[3, 3]; for (int i = 0; i < grid.GetLength(0); i++) { for (int j = 0; j < grid.GetLength(0); j++) { if (grid[i, j] == 'X' || grid[i, j] == 'O') { return; } if (position == 1) { grid[0, 0] = player; } else if (position == 2) { grid[0, 1] = player; } else if (position == 3) { grid[0, 2] = player; } else if (position == 4) { grid[1, 0] = player; } else if (position == 5) { grid[1, 1] = player; } else if (position == 6)

Questions about programming?Chat with your personal AI assistant