# Simple Tic Tac Toe project im stuck

I could just Youtube how other people do this but thats not the point of projects i want this to be my own and not copied from other sources .

My question about this simple code is : How do i write this simple check_winner() function or maybe it is not as simple as it seems ( thats what i always think when im stuck ) ive tried everything i know also googled some and found nothing so my last resort is to post it on a Forum .
Thanks if someone helps out
Also if u post a solution that is complicated could u explain a bit the code u posted?

Love

import time

def change_turn():
pass

# if its x turn == x winner if o turn == o winnner

def check_winner():
# if board[0][0] == “x” and board[0][1] == “x” and board[0][2] == “x”: NO
# if board[0] == “x”: NO
# print(“X WINS !”) NO
# i got bored 14:03
for row in board:
if row[0][0] == “x” and row[0][1] == “x” and board[0][2] == “x”:
print(“X IS THE WINNER !”)

``````pass
``````

row1 = [“”, “”, “”]
row2 = [“”, “”, “”]
row3 = [“”, “”, “”]

board = [row1, row2, row3]

def game_engine():
Bool = True

``````while Bool:
print(f"{row1}\n{row2}\n{row3}\n")

place_x = input("X Turn to play\n").lower()

horizontal = int(place_x[0])
vertical = int(place_x[1])
place_x = board[horizontal -1][vertical -1] = "x"

print(f"{row1}\n{row2}\n{row3}\n")

place_o = input("O Turn to play\n").lower()

horizontal = int(place_o[0])
vertical = int(place_o[1])
place_o = board[horizontal - 1][vertical - 1] = "o"

print(f"{row1}\n{row2}\n{row3}\n")

check_winner()
``````

game_engine()

@blawrytan

Welcome to the community!

I made a TicTacToe program some time ago. Find here: TicTacToe Two Player Game

You may be interested in the `status` method.

Unlike in machine learning where the algorithm generates the rules, you have to specify the rules in general programming. You can win a TicTacToe game in 8 ways.