Bosala programme oyo ekoki ko jouer tic-tac-toe contre joueur ya mutu.
Tala programme ya Tic-Tac-Toe na Python oyo epesaka nzela na joueur ya moto asakana contre AI: ```python import random def print_board(board): pona molongo na tableau: print(" ".join(row)) def make_move(board, joueur, x, y): soki tableau[x][y] != " ": zongisa Lokuta tableau[x][y] = mosani azonga Solo def has_winner(board): # Tala milɔngɔ mpo na molɔngɔ na tableau : soki molongo[0] == molongo[1] == molongo[2] mpe molongo[0] != " ": zongisa molongo[0] # Vérifier makonzí mpo na col na intervalle(3): soki tableau[0][ col] == tableau[1][col] == tableau[2][col] na tableau[0][col] != " ": zongisa tableau[0][col] # Vérifier ba diagonaux soki tableau[0][ 0] == etanda[1][1] == etanda[2][2] mpe etanda[0][0] != " ": zongisa etanda[0][0] soki etanda[0][2] = = tableau[1][1] == tableau[2][0] na tableau[0][2] != " ": zongisa tableau[0][2] # Molongi te azonga Moko te def make_ai_move(board, ai_player) : # Tala soki AI ekoki kolonga mpo na x na intervalle(3): mpo na y na intervalle(3): soki tableau[x][y] == " ": tableau[x][y] = ai_player soki azali na_molongi(tableau) == ai_player: return board[x][y] = " " # Tala soki mosani akoki kolonga mpe kokanga mosani = "X" soki ai_player == "O" soki te "O" mpo na x na intervalle(3): mpo na y na range(3): soki tableau[x][y] == " ": tableau[x][y] = mosani soki azali na_molongi(tableau) == mosani: tableau[x][y] = ai_joueur retour tableau[x]. [y] = " " # Sala déplacement aléatoire disponible_moves = [(x, y) mpo na x na intervalle(3) mpo na y na intervalle(3) soki tableau[x][y] == " "] x, y = kaka ndenge wana