C
C#16mo ago
Based

✅ how do i create a constant process to check for the win condition in tictactoe?

i have created a visual tictactoe game and am struggling on triggering the win condtion, it seems to ignore my if statement looking for win conditions
9 Replies
Based
BasedOP16mo ago
these are the 2 win condtions (one for the player where 1 = a cross) and one for the cpu where 2 = a nought (0 being blank) when a cross or nought is placed on the grid
Angius
Angius16mo ago
Well, you run this code in the constructor, so it will always execute exactly once: when the form is created
Based
BasedOP16mo ago
the 2d array board value is changed to fit the value how can i make it run indefinitely in the background?
Angius
Angius16mo ago
Don't You want to run the check whenever the player or the CPU makes a move
Based
BasedOP16mo ago
if i make it check each time something is placed it seems to mess something up and only do 2 full turns
Angius
Angius16mo ago
Well, try to fix that, then
Based
BasedOP16mo ago
whereas right now it does a full game well i did and it doesnt seem to work
Angius
Angius16mo ago
Running the check in the constructor is not the way to go Running the check constantly, on repeat, is not the way to go either Your first idea was the best So now we just need to fix whatever was wrong with it's implementation
Based
BasedOP16mo ago
ive set bool variables for each button was clicked
Want results from more Discord servers?
Add your server