Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

you will develop a zero sum ( adversarial ) tic - tac - toe game ( noughts and crosses ) by implementing Minimax and its

you will develop a zero sum (adversarial) tic-tac-toe game (noughts and crosses) by implementing Minimax and its variation called Negamax algorithm which will consist of a MAX (human) and MIN (a computer) players. The human player MAX will play against the machine on a larger tic-tac-toe board where it will move first, and then the MIN player takes turns moving until the game is over. At the end of the game, points are awarded to the winning player and penalties are given to the loser. You will use the extensively studied elements to formulate your game scenario: S0: The initial state, which specifies how the game is set up at the start. TO-MOVE(s): The player whose turn it is to move in state s. ACTIONS(s): The set of legal moves in state s. RESULT(s,a): The transition model, which defines the state resulting from taking action a in state s. IS-TERMINAL(s): A terminal test, which is true when the game is over and false otherwise. States where the game ended are called terminal states. UTILITY(s,p): A utility function (also called an objective function or payoff function), which defines the final numeric value to player p when the game ends in terminal state s. In chess, the outcome is a win, loss, or draw, with values 1,0, or 1/22. Some games have a wider range of possible outcomesfor example, the payoffs in backgammon range from 0 to 192.Your solution should work for the board of any configuration from 3\times 3 board size 5\times 5(or even larger size if your machine permits). In a typical tic-tac-toe board game of size 3\times 3, the smart opponent (utilizing Minimax) tries for a draw (i.e., the value of the root to be 0) which means at the end of the game no 3 triplet cells (in any of the horizontal, vertical, or diagonal direction) have the connecting symbol chosen by a human player. In this game, you can either choose a nought (0) or a cross (X) as your (human player) symbol. However, in a larger board, the end goal changes where the win is for the player who has the larger number of triplets with matching symbols. For example, in this sketch of a 4\times 4 board on the right, both players still draw the game with the score of 3 each.
Provide code and comments for the functions in the screenshot
def get_negamax_scores(self, terminal):
def get_scores(self, terminal):
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data In Just 7 Chapters

Authors: Prof Marcus Vinicius Pinto

1st Edition

B09NZ7ZX72, 979-8787954036

More Books

Students also viewed these Databases questions

Question

1. To what extent is creativity expected and encouraged?

Answered: 1 week ago