Assignment #2 Solution

$29.99 $18.99

overview In assignment 2, you will build on the foundation laid out in assignment 1 in order to add a new game, called Stonehenge, and a new strategy, called minimax (for which you are to implement an iterative version and a recursive version). Starter code has been provided so that you should be able to…

You’ll get a: . zip file solution

 

 
Categorys:
Tags:

Description

Rate this product

overview

In assignment 2, you will build on the foundation laid out in assignment 1 in order to add a new game, called Stonehenge, and a new strategy, called minimax (for which you are to implement an iterative version and a recursive version). Starter code has been provided so that you should be able to \plug in” your new classes for games, and new strategies, without re-writing existing code. By the end of this assignment, you’ll have a new game and a much stronger opponent to play against.

stonehenge

Stonehenge is played on a hexagonal grid formed by removing the corners from a triangular grid. Boards can have various sizes based on their side-length (the number of cells in the grid along the bottom), but are always formed in a similar manner: For side-length n, the rst row has 2 cells, and each row after has 1 additional cell up until there’s a row with n + 1 cells, after which the last row has only n cells in it.

(a) A stonehenge grid with a side-length of 2 (b) A stonehenge grid with a side-length of 3

Players take turns claiming cells (in the diagram: circles labelled with a capital letter). When a player captures at least half of the cells in a ley-line (in the diagram: hexagons with a line connecting it to cells), then the player captures that ley-line. The

rst player to capture at least half of the ley-lines is the winner. A ley-line, once claimed, cannot be taken by the other player.

For your implementation of Stonehenge, you must fulll the following specications in order for us to test your code:

5