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

  • Math 533 Part C
    2018 words | 9 pages
  • Nursing research Utilization section C
    991 words | 4 pages
  • Stenden Hots Part C
    3833 words | 16 pages
  • QHT1 Task 4 Johnloyd 123114
    1471 words | 6 pages
  • John C Maxwell Leadership 101
    1920 words | 8 pages
  • Week 4 Linking Questions
    982 words | 4 pages
  • Mr C Higgins
    3060 words | 13 pages
  • Chapter 4 Risk Management
    1329 words | 6 pages
  • Microeconomics Chapter 4
    1221 words | 5 pages
  • Vitamin C Content of Fruit Juices
    2410 words | 10 pages