Posts by jmb2001 • 5 points
3 posts
-
0
votes2
answers136
viewsA: Win function in Tic-tac-toe - Python
I did so: def winner(paper): wins = [ [0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]] for pos1, pos2, pos3 in wins: if paper[pos1] == 'X' and paper[pos2] ==…
-
-3
votes2
answers136
viewsQ: Win function in Tic-tac-toe - Python
Hello! Facing the construction of an old game in Python, I’m doing a victory function, which will alert which of the players won the match. Below is the game algorithm under construction: def…
-
0
votes2
answers142
viewsQ: Problems for player play order in Tic-tac-toe
I have trouble with the job players(), because I can’t increment the variable n, the function is only returning "X". I know it sounds pretty simple, but I can’t identify the problem. Can anyone help…