How to make Game Menu buttons disable others?

I’m still very new to UPBGE and trying to make a game menu currently. Imagine 9 buttons in a 3 by 3 grid. I need it to where you can only choose one button per column and per row. For example:

1 2 3
4 5 6
7 8 9

If you chose 1, then you wouldn’t be able to choose 2, 3, 4, or 7. This would leave you with 5, 6, 8, and 9. If you then chose 8 the last option available would be 6.

I’m fairly certain this is possible, I just don’t know where to start. Any help is much appreciated.

Depends on how you create your menu and if you want to select by keyboard or mouse.
For example with mouse and selecting with mouseover sensor:
you could have a mask-plane is shaped like a “+” which is placed at the selected button. It then masks the unselectable buttons.
Or with code:
each button has a property “row” and “column”. you can iterate over the rows and columns and set all “same property value” to “inactive”
Pseudo code:

for button in all_Buttons:
   if button['row']==selected_button['row'] or button['column']==selected_button['column']: button['selectable']=False