Skip to content

the-phinisher/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe

An implementation of the Minimax algorithm on the Tic-Tac-Toe game

The minimax algorithm

Pseudo-code for the algorithm implemented:

minimax(state, depth, isMaximising):
    # End point condition
    if depth = 0 or end(state):
        return move = None , score = evaluation(state)
    
    # If not an end point Node
    else:
        if isMaximising:
            # Set the best initially to least
            bestMove =  None
            bestScore = -infinity
            for every move in possible_moves(state):
                score = score(minimax(state_with_move(state, move), 
                depth-1, not isMaximising))

                if score > bestScore:
                    bestMove = move
                    bestScore = score
        # Invert for minimising

About

Tic Tac Toe Game with Minimax algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published