Module Code…CO1451.
Module Title… Programming in C++
Module Tutor Harvey Long
Assignment Title/Number……No.1…
……………………………
Student Name……Stephen Allen
Student ID No… All09109979
I confirm that this piece of work which I have submitted is all my own work and that all references and quotations from both primary and secondary sources have been fully identified and properly acknowledged in footnotes and bibliography.
Signature of student.........ste allen..............................................................
Introduction
The game of connect 4 consists of two players that take alternate turns to drop counters into a grid. There are two styles of counter so that each player has their own. The grid is a 7 by 7 table making a total of 49 elements. The object of the game is for the first player to make a straight line of 4 matching counters in any direction. The game is played by players choosing which column to drop their counter and that counter falling to the lowest empty row in that column. As more turns are taken, more opportunities arise where lines of 4 matching counters can be achieved in horizontal, vertical and diagonal directions.
The game goes on with each player attempting to match a line of 4 of their own counters whilst simultaneously sabotaging any matching lines of their opponent. If no matches are found throughout the game then the game ends after 49 turns have been taken and all the elements are filled.
Design
Upon running the desired program the users would be presented with a menu offering 3 options. These options can translate into a switch:case:break function within the program and the typical menu will be:-
Case1: (option 1) Play Connect 4
Case2 : (option 2) View League Table
Case3 : (option 3) Quit Key in option number and press enter!
Upon choosing case1 users will be asked to key in player1 and player2 names.
A grid with seven rows