okay, so the idea here is an "SOS" game (current project at https://github.com/johncwelch/SOS-Swift)
basically, it's an over complicated version of tic-tac-toe, where each player attempts to spell SOS by clicking on the buttons.
the buttons have three options:
Blank (starting default)
"S"
"O"
The buttons can also be enabled or disabled depending on a few things:
if they've already been used, then they're not clickable
if they're blank, but another button is being used by a player, they have to be enabled when that other button is blank, but disabled when the other button is "S" or "O" so that only one button can be used in a move.
So on completion of a move, the following has to happen:
If "S", are any of the buttons next to me "O"? If so, is the button in a line with that "O" an "S". If so, SOS, set the button color of all three to match the player color, (red or blue), disable myself, add a point to the player who made SOS, and change the current player to the other player. If not, just disable the button and change the current player to the other player.
if "O", are the buttons on opposite sides of me both "S"? If so, SOS, set the button color of all three to match the player color, (red or blue), disable myself, add a point to the player who made SOS, and change the current player to the other player. If not, just disable the button and change the current player to the other player.
So i need to be able to both read state of other buttons on the playing field and modify the state of other buttons based on what happens in a click on a current button.
There's also a "new game" option, which blows up any current game (if in the middle), sets scores to 0 and sets all buttons to blank + enabled.
Tracking button state is kind of critical here, both for the current title of the button and its enabled/disabled state.