ABSTRACT
This nifty assignment challenges CS 2 students to implement the backend for a variation on the Hex board game. In a typical Hex game the winner is the player connecting a continuous series of their playing pieces from a specific side of the board to the other. In this variation, we add the concept of a score, which is the number of connected components of a given color. The students are provided with the front end of the game, various board sizes, unit-tests and a game simulator. They are tasked with keeping track of the state of the game. The assignment is nifty because students are interested in the game aspect and there are a number of possible solutions for the disjoint set tracking required in the backend. This leads to engaging in-class discussions that are elevated above coding specific details and focused on design and performance leading to strong learning opportunities. The unit-tests provide debugging and software development skills for students and automatic grading of some functional aspects of the work. Students could easily be tasked with creating their own unit-tests in a variant on this original. In the end students end up with a working game that is fun to play and interesting to thinking about algorithmically.
Supplemental Material
Index Terms
- Islands of Hex
Recommendations
How to play Reverse Hex
We present new results on how to play Reverse Hex, also known as Rex, or Misère Hex, on n í n boards. We give new proofs-and strengthened versions-of Lagarias and Sleator's theorem (for n í n boards, each player can prolong the game until the board is ...
Solving 7×7 Hex with domination, fill-in, and virtual connections
Advances in computer gamesWe present an algorithm that determines the outcome of an arbitrary Hex game-state by finding a winning virtual connection for the winning player. Our algorithm recursively searches the game-tree, combining fixed and dynamic game-state virtual ...
Hex ist PSPACE-vollständig
There are a number of board games such as Checkers [2], Go [5], and Gobang [8], which are known to be PSPACE-hard. This means that the problem to determine the player having a winning strategy in a given situation on an n n board of one of these games ...
Comments