Java Programming assignment is to implement an AI agent that can play checkers.
ID: 3684924 • Letter: J
Question
Java Programming
assignment is to implement an AI agent that can play checkers. Please, read carefully. You'll need to create a playing environment in which both the human and AI can make moves.
You do not need to implement any GUI for this. A simple command prompt based menu will work.
The parts of this assignment are as follows:
1. A simple turn-based game, where both the human and AI make moves on a checkers board. The program should output a very simple text-based representation of the board.
2. When it's the human's turn, the human types the coordinates of "from cell" and the "to cell". Each coordinate is of the form< columnindex><rowindex>: ex: "45" goes to "56".
3. When it's the AI's turn, it will run the alpha-beta algorithm, which outputs the suggested move. For this, you'll need to implement the alpha-beta algorithm, whose pseudo-code is provided. Each state in the alpha-beta algorithm corresponds to a state in the game. One way to represent the state is with a 8x8 array. Each cell is either 0 (blank), 1 (white piece), 2(white queen), -1(black piece), -2(black queen).
4. Implement the heuristic evaluation that is used to evaluate the states at a certain depth (say depth 4). Come up with 2-3 simple heuristic features.
Explanation / Answer
Initially worry about the modeling the board, and implementing the game engine first. Make it so you can play checkers on the command line. You can type in your move, and the computer prints out what move it makes. Then work for putting fancy graphics on top
What you need to do this is a data structure to represent the board. So, you need a class for each piece, and a class for the board that contains the pieces. This is the easy part
Then you need to work on your engine, which is the hard part. Basically, you need the game engine should be able to
a) find out all the legal moves
b) find out if the board have a win/loss
c) For a given move change the state of the board based
d) if you want the computer to play, you need some way to rank the legal moves so you can pick the move that is most likely to lead to a win
d) is hard. If you had lots of memory, you could keep every possible combination of moves in a tree like structure; you could walk the tree to figure out the move that is most likely to result in wins.
note- Implement the question in the above mentioned way.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.