boardstate[]
public void UpdateBoard(Disk[,] boardState){ // Loop through the board state (2D array) and place pieces for (int row = 0; row < 8; row++) { for (int column = 0; column < 8; column++) { var tile = BoardGrid.Children[row * 8 + column] as Border; // Get the corresponding tile // Find the Ellipse inside the Border var ellipse = tile?.Child as Ellipse; if (boardState[row, column] == Disk.White) { ellipse.Fill = Brushes.White; } else if (boardState[row, column] == Disk.Black) { ellipse.Fill = Brushes.Black; } else { ellipse.Fill = Brushes.Transparent; // Empty cell } } }}