tic-tac-toe

List not defined in a function in Python

List not defined in a function in Python Question: I am working on one of my first codes (Tic Tac Toe), and I cannot figure out why I’m getting a name error. First I have a list (board). Then I have a function (possible_victory_for() ) that I define. It is supposed to to something with …

Total answers: 1

How to make my number board start at 1 end at 9 and arrange itself in 3 rows

How to make my number board start at 1 end at 9 and arrange itself in 3 rows Question: I’m trying to understand this code from "12 Beginner Python Projects – Coding Course" on the FreeCodeCamp Youtube channel and I really don’t understand this code to print a board for the Tic Tac Toe project. …

Total answers: 1

Tic Tac Toe Program in Python shows errors when checking for diagonal wins

Tic Tac Toe Program in Python shows errors when checking for diagonal wins Question: I’m making a tic tac toe in python and when creating a diagonal check, I keep getting the wrong results. In my script, I have a 2D list with all of the values on the board: filled = [[‘n’,’n’,’n’], [‘n’,’n’,’n’], [‘n’,’n’,’n’]] …

Total answers: 1

mini_max not giving optimal move tic tac toe

mini_max not giving optimal move tic tac toe Question: iam making a minimax program for tic tac toe in python it works in some state but other it jest return first space call in array space = ‘ ‘ def rate_state(state): ”’ this def is returning 10 if X wins -10 if O wins 0 …

Total answers: 1

why minimax don't choose the optimal solution in this situation

why minimax don't choose the optimal solution in this situation Question: im doing tictactoe project for cs50 course when i was using minimax i find out the minimax in some situation couldnt find the optimal solution here is my code : """ Tic Tac Toe Player """ import copy import math X = "X" O …

Total answers: 2

Tic Tac Toe Game using Turtle

Tic Tac Toe Game using Turtle Question: This is for an extra credit assignment in Python. I’ve finished most until the last part where I have to determine the area of the tictactoe box chosen. I can only detect diagonal boxes, used from combining both code reply’s below. I can detect those 3 boxes but …

Total answers: 2