Repository for projects completed for CS50 AI course
Overview
Implemetation of Minimax algorithm to play Tic-Tac-Toe game optimally. This code is created based on distribution code offered by CS50.
Specification of implemented functions
-
The player function should take a board state as input, and return which player’s turn it is (either X or O).
-
The actions function should return a set of all of the possible actions that can be taken on a given board.
-
The result function takes a board and an action as input, and should return a new board state, without modifying the original board.
-
The winner function should accept a board as input, and return the winner of the board if there is one.
-
The terminal function should accept a board as input, and return a boolean value indicating whether the game is over.
-
The utility function should accept a terminal board as input and output the utility of the board.
-
The minimax function should take a board as input, and return the optimal move for the player to move on that board.
Usage Run game: runner.py