+ 2

Help with Tic tac toe python

I got everything working perfectly fine until I tested it, and found out that when there is a win, but the entire board is filled, it results in a tie. https://sololearn.com/compiler-playground/cesQcCzC2X47/?ref=app

10th Jul 2024, 12:25 AM
Jonathan Dodge
Jonathan Dodge - avatar
15 odpowiedzi
+ 2
My first guess would be that the check for a tie was running before the check for a win, but this does not seem to be the case, so I believe the check for a win must be flawed.
10th Jul 2024, 12:27 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 1
I just realized I used an if for the is_tie function instead of an elif. I fixed it. It works.
10th Jul 2024, 3:06 AM
Jonathan Dodge
Jonathan Dodge - avatar
+ 1
Jonathan Dodge Don’t confess such lies on yourself! Besides, you literally just found a mistake you made and corrected it. You’re not dumb.
10th Jul 2024, 3:54 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 1
It took me 4 hours, and it was because there was an if instead of an elif.
10th Jul 2024, 8:57 PM
Jonathan Dodge
Jonathan Dodge - avatar
+ 1
Also I used ai to help
10th Jul 2024, 8:58 PM
Jonathan Dodge
Jonathan Dodge - avatar
+ 1
Someone who has a bunch of book learning, but doesn’t know how to apply it, is dumb. You didn’t know the technical aspects, but you knew how to respectfully ask for help, and you succeeded. That’s wise.
11th Jul 2024, 12:10 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 1
Also, how do you know he didn't get cursed by the wizard of Oz to be an immortal cat confined to this mobile app?
11th Jul 2024, 3:03 AM
Jonathan Dodge
Jonathan Dodge - avatar
+ 1
Jonathan Dodge ‘Cause the Wizard Of Oz was a fever dream.
11th Jul 2024, 1:26 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 1
CodingMaster Never throw unexplained code at someone trying to fix their own. That makes it very tempting to just give up learning and use yours blind.
11th Jul 2024, 7:35 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
I'm dumb
10th Jul 2024, 3:08 AM
Jonathan Dodge
Jonathan Dodge - avatar
0
You're frisk from undertale, aren't you?
11th Jul 2024, 2:36 AM
Jonathan Dodge
Jonathan Dodge - avatar
0
Frisk doesn’t ever say anything. And he isn’t a cat. He is yellow, though. Also, fun fact, Undertale was programmed horribly, but it’s still a good game. Toby Fox isn’t dumb, and you aren’t dumb. See? 😀
11th Jul 2024, 3:00 AM
Wilbur Jaywright
Wilbur Jaywright - avatar
0
He doesn't say anything because he is being controlled by the character.
11th Jul 2024, 3:01 AM
Jonathan Dodge
Jonathan Dodge - avatar
0
Are you sure he is?
11th Jul 2024, 10:23 PM
Jonathan Dodge
Jonathan Dodge - avatar