Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

159.270 Hardware-Oriented Computing

Project 1: Game Development


Instructions:


 

Develop a computer player for a 4x4 checker game.

 

A             B             C             D

4

 

3

 

2

 

1

Game rules:

-     The starting position is as shown above

-      In their turn, a player may move a piece 1 step diagonally forward (eg. B1-A2, or A4-B3)

-     A piece may jump a single opponent’s piece into a vacant square on the other side (eg if     there was a red piece at C2, then green could play B1-D3 or D1-B3). Any jumped pieces are captured and removed from the board.

-      When a piece reaches the far end (green reaches row 4 or red reaches row 1), it becomes a King, and is allowed to move 1 step diagonally in any direction, either forwards or                 backwards.

-     A player loses the game if they cannot make a legal move. Either their pieces are blocked, or all of their pieces have been captured.

-     The game is a draw when both players have made 20 moves each (40 moves total).

This will require you to:

-      Implement the game play. This is best implemented as a class that represents the game state, with a method for playing a move.

-      For a given position, generate a list of possible moves.

-      Represent at least three turns of play using a tree structure.

-      Write an evaluation function to estimate the strength of a position at each of the leaf nodes of the tree. The evaluation function should not be random, but may include a small random component.

-      Use a search algorithm to find the best move for the current position.

-      Create a minimal graphic interface allowing a user to play against the computer opponent. This can be text-based graphics on a console window.

Task 1: Write classes for representing game state and move (see Workshop 2).

Task 2: Build a console-based user interface to your game, and be able to play a manual game (see Workshop 4).

Final submission: Have a complete computer player implemented.

Marking rubric for final submission:

•    Code is complete and executable (/30)

o It compiles and runs correctly

o It presents a suitable interface to the user; easy to use

o It correctly plays a game

•    Code is well structured (/30)

o Code is formatted consistently

o Appropriate use is made of classes

o Code is adequately commented, with header documentation for each function

•    Algorithms and data structures are appropriate (/40)

o Appropriate structures are used for tree / graph

o These are encapsulated within suitable C++ classes

o Appropriate searching and sorting algorithms are  used  (with  brief justification  in the class / function header)

o Corresponding header documentation analyses the Big-O complexity of searching and sorting algorithms)

Plagiarism

Your submission must be your own work. If you make use of libraries or other code sources, these should be cited in appropriate comments or header documentation.

Submission:

You must submit all project and source files as a single Zip via Stream.

The code must compile on Qt 6.3.

For evaluation, we will:

1)   Compile the code

2)   Play a (manual) game against the computer

3)   Examine source code according to the above rubric