Hi Guys,I am having a bit of problem understanding the Logic in following piece of code from Tic Tac Toe example.Could anybody please explain me how the code works.. :sign0085:
B4X:
'Check diagonals
found = True
For i = 0 To 2
found = found AND Buttons(i, i).Text = Player
Next
If found = True Then Return True
found = True
For i = 0 To 2
found = found AND Buttons(i, 2 - i).Text = Player
Next
If found = True Then Return True
Return False
I want to use part of the tictactoe code for4 an app of mine, but I need to know what button has been clicked.
I have three rows of buttons, but I am unclear on how to i:sign0104:dentify the button.