I’m engaged on a board sport that requires me to paint the underside left nook of the board with random variety of rows and columns a unique colour from the opposite blocks. Given an m x n grid, how do I calculate the index of the underside left block?
On a 4×4 block, the index is 12, on a 3×3 block the index 6, on a 2×2 block the index is 2, on a 3×4 block the index is 8, and on a 4×3 block the index is 9. Thanks prematurely for the assistance!
I attempted the next nevertheless it colours the highest left field as a substitute of the underside left:
for(int r = 0; r < numRow; r++){
for(int c=0; c < numCol; c++){
if(r==numRow-1 && c==0){
buttons[c].setBackground(new Shade(250, 0, 0));
buttons[c].setEnabled(false);
}
}
}