raziehyria / TicTacToe-with-MinMax

tictactoe python implementation with minmax and alphabeta pruning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

442_pythonProject1

    tictactoe python implementation with minmax and alphabeta pruning.
    Project-1 Game Playing.
    Minimax Algorithm & Alpha Beta Pruning Algorithm.

This project consists of designing and implementing a program that plays Tic-Tac-toe. You should be implement using minimax and also using alpha beta pruning, and compare the results. You can use any heuristic (evaluation/static) functions to perform the adversarial search. This project will give you more experience on the use of:

  1. Minimax algorithm
  2. Alpha Beta pruning algorithm Project parts:

Part-1:  Develop an application to play a tic-tac-toe game using minimax and alpha beta pruning algorithm i.e., AI vs the player. (2 implementations – one using minimax and one using alpha beta pruning)  Your program should allow the user to play and complete the game.

Part-2:  Develop a function which takes a set of inputs from the 2-player game i.e., any state and outputs an optimal move for the player i.e., optimal state.  Your program should also take an input set and provide an optimal move for that input. For example, consider the below input. You are the "X" player, it is your turn to move, and the current board configuration is shown below:

          |   |
          |   | O
          |   |
       -----------
          |   |
        X | O | O
          |   |
       -----------
          |   |
          |   | X
          |   |

Answer the following:

  1. What will be your optimal move according to Minimax and also with Alpha beta pruning?
  2. Does both the algorithm suggest the same move?
  3. How many nodes does it visit?
  4. Perform a hand calculation for the above set and compare the result with the program result. Is it the same?

About

tictactoe python implementation with minmax and alphabeta pruning


Languages

Language:Python 100.0%