0% found this document useful (0 votes)
3 views3 pages

Tic-Tac-Toe MinMax Algorithm Code

The document outlines a practical implementation of the MinMax algorithm and Breadth First Search for the Tic-Tac-Toe game. It includes a code snippet that initializes the game board and sets up the current player. The function to print the game board is also defined.

Uploaded by

adityanaikwadi17
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Tic-Tac-Toe MinMax Algorithm Code

The document outlines a practical implementation of the MinMax algorithm and Breadth First Search for the Tic-Tac-Toe game. It includes a code snippet that initializes the game board and sets up the current player. The function to print the game board is also defined.

Uploaded by

adityanaikwadi17
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#OUTPUT

:
PracticalNo.2:
CODE:
#Class- SY B
#RollNo.:B-55
#Name:VinayShinde
#ProblemStatement:ImplementationofMinMaxalgorithm/BreadthFirstSearchforTic-Tac-Toe Problem.

import random

board=["-","-","-",

"-","-","-",

"-","-","-"]

currentPlayer = "X"

winner = None

gameRunning=True

#gameboard

defprintBoard(board):

print(board[0]+"|"+board[1]+"|"+board[2])

print("---------")

print(board[3]+"|"+board[4]+"|"+board[5])

print("---------")

print(board[6]+"|"+board[7]+"|"+board[8])

You might also like