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 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
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.
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.
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.
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.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu
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. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
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
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