INTRODUCTION
Your task in this assignment is to produce a new version of the traditional board game Connect Four (see https://www.mathsisfun.com/games/connect4.html). In the original game, a board with 7 columns and 6 rows is placed vertically. Two players with different coloured pieces choose a column and put a piece in it, which falls to the bottom. The winner is that who gets 4 pieces with the same colour connected in a straight line (horizontally, vertically, or diagonally).
The game variation for this assignment is a bit different . The winner must connect 4 pieces vertically or horizontally only. The diagonals are not considered.
ASSIGNMENT CORE TASK (10.0 Marks)
The board will be implemented as an array of seven stacks. Each stack should be implemented as taught (using Node, LinkedList and LStack classes).
As usual, the main file will be provided. You will need to implement the logic of the game inside the class GameplayStack: how to add pieces, checking for the winner or tie after each piece is added to the board, and displaying the board at the end.
The board should be displayed as below:
You will note that the game has no real user interface when played with the Connect4Demo.cpp or Connect4Template.cpp – using these files you will ONLY see the final state. Your submission must work the same way.
BONUS TASK (2.0 Marks)
SENG6120 students are REQUIRED to complete the Template Option as part of their Core Task
(2.0 mark) Implement the Task using class templates; your code needs to work with the GamePiece class and thecpp demo that was provided. You will need to update the supplied makefile to use the Connect4Template.cpp demo file; there is an alternate SOURCES line in the make file – swap the remark # between the two SOURCES lines.
Comments are closed.