(5/5)

in this assignment you will write a two player board game.There is a 6x6 board, a parametric turn limit and 8 pieces for each player

INSTRUCTIONS TO CANDIDATES

Introduction to Artificial Intelligence

In this assignment you will write a two player board game.There is a 6x6 board, a parametric turn limit and 8 pieces for each player.On each turn current player makes a single move:Moving his piece to one of its four neighbours. Don’t forget the board is the same board for both players.Game ends when one of the players has no piece on the board or the turn limit is reached.your game will be played between AI and a user.

In the beginning, your program will ask if the user will be Player1 or 2. If user is Player1, the first move will be user’s. Otherwise computer will make the first move. If user decides to play first, the input must be 1 otherwise it is 2.At the start of the game the maximum number of turns will be given by the user.

After board is initialized and at the end of each turn you need to print the coordinate system and the squares occupied with pieces labeled by their player indicator.

Computer’s turn

Computer will move its piece to an available square and print the new position as shown below. Computer should always make a valid move.

Computer moves the piece at f4 to f5

User’s turn

If it is user’s turn, user will type the desired move in same structure as the computer. First the coordinate of the piece that is wanted to be moved and then the new coordinate of the piece.

Choose piece to move: c4 Choose the new position for c4: d4 Player moves the piece at c4 to d4

You must check whether the desired moves and the piece coordinates are valid or not! If not, ask user for a valid move or a valid piece coordinate again.

Move Rules

You need to define Player1’s indicator as “X” and Player2’s as “O” in the printed representation.

Players can not move outside of the field. Players can not move to the squares occupied by the their opponent or by their own pieces.

Players can only move their piece to one of its four neighbours. Move can be vertical or horizontal.

!!!Players can also jump over the pieces in their four neighbours if the square behind the neighbour piece is empty.

Players can not move the piece to its previous location in their next move. If the Player wants to move the piece “A” to its previous location another piece should be moved first in that turn. “A” then can be moved to its previous location in the next turn.

Deletion Rules

If a piece’s 4 neighbours are occupied with their opponent’s pieces, then that piece will be removed from the board.

No new pieces will enter the game after the game is initialized.

Coordinate System

Your coordinate system must meet the following rules:

Columns are represented as numbers between “1 and 6”.

Rows are represented as letters between “a-f”. (“a1” is top left square and “f6” is bottom right.)

Ending & Winning

The game ends when one of the players can not make a valid move or the turn limit has been reached.

When one of the players can not make a valid move or there are no pieces left on the board for a player, the game ends and the other player will be the winner.

When the turn limit is reached, the game ends and the player with more pieces on the board will be the winner.

In the case of having equal number of pieces for each player, winner will be decided based on the number of possible moves for all pieces. If these values also are the same, there will be no winner and the game will be a draw.

You will be graded based on your AI’s strength. Your AI algorithm must be an algorithm other than random. You must provide a heuristic function which will be applicable to any limit value. Your implementation must have a search tree, alpha-beta pruning and a heuristic function.

(5/5)

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Hire Me