Connect 4 in C++

4596 words 19 pages
Course Title…FD COMPUTING 1ST YR

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
…show more content…

fstream outfile //league table data
Also not yet covered in this design stage is the use of outfile.open(“test.txt”,ios::out); to create or update the league tables or outfile.open(“test.txt”,ios::in); to view the league table or outfile.open(“test.txt”,ios::app); to add new players to the league tables.

Connect 4 Algorithm
The algorithm for the actual gameplay I have designed is as follows: Play game
Reapeat until WINNER is found or moves taken = 49
Player1 enter name= nameA
Player2 enter name= nameB nameA chooses column= choiceA choiceA= 1st available empty element in that column
1st available element= choice[row][column] choice[row][column]= “nameA counter” moves taken = moves taken + 1 if moves taken >8 then check for line of 4

Related

  • NT1210 Final Exam Review
    1580 words | 7 pages
  • NT1230 Chapter 7 Questions
    1155 words | 5 pages
  • Business Data Communication and Networks test bank
    15147 words | 61 pages
  • Open Innovation
    5947 words | 24 pages
  • network consultation proposal
    1646 words | 7 pages
  • Physical Network Layer Concepts
    1070 words | 5 pages
  • NT2799 Oral exam Study Guide
    1624 words | 7 pages
  • Midterm 2 Solutions
    1890 words | 8 pages
  • Argumentative: Bibliography and Additional Information
    1223 words | 5 pages
  • Group Proposal Project
    4601 words | 19 pages