Preview

The creation of Tic-Tac-Toe game using the C/C++ language, includes full code of the actual program

Powerful Essays
Open Document
Open Document
3256 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
The creation of Tic-Tac-Toe game using the C/C++ language, includes full code of the actual program
Introduction

This is the final report showing all the work put into Mark Smith and Trevor Snaith's noughts and crosses program, for this semesters work. The report includes the aims throughout the project, which is to produce a noughts and crosses programme in "C", the problems which we encountered during writing the program and how we solved them. It shows the results of our noughts and crosses program including some printout from the program and an explanation of how the programme works. It also shows some improvements on how the programme could be made better, and a conclusion.

Aims

To develop a "C" program that allows two people to play "noughts and crosses. The computer must decide when the game has been won and by whom, or whether the game has been drawn. The computer should display the board after each move.

Results

When the programme is first run the opening screen appears as below:-

This opening screen is put together using a series of "printf" functions. It asks the user if they wish to play, if the user decides to play they key in number one. The one is stored as an integer in a box called "play". Using an if statement, if play is equal to one then this follows:-

Once the one is pressed then the rules appear and using a printf statement to bring up "Player 1 (x) please enter your first name", Mark the first player then enters his name which is stored using a scanf statement. Once his name has been entered and the carriage return button is pressed then "Player 2 (o) please enter your first name" appears. Trevor the second player enters his name, which is also stored as a scanf statement. Once the carriage return is pressed the following appears:-

"Mark will go first" appears using a printf statement. Before the board appears the computer checks using a while statement to see if there is a win for "x - Mark", "0 - Trevor" or a draw, if none of these statements are true then the board is displayed and "Mark please enter a row number and press enter"

You May Also Find These Documents Helpful

  • Powerful Essays

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 1488 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    It/210 Final Exam

    • 1235 Words
    • 5 Pages

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 1235 Words
    • 5 Pages
    Good Essays
  • Good Essays

    3) How would you display the Designer window if it is not visible in your project?…

    • 3668 Words
    • 15 Pages
    Good Essays
  • Good Essays

    To fully test my program, test data needs to be created that can fully push the program to its boundaries or even further by causing a crash or error during execution. This will ensure that all errors and bugs are discovered so they can then be corrected.. The whole program will be played several times to make sure it works from the start to the end without any errors or bugs being encountered and to ensure it gives the correct outputs.…

    • 1040 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Cis170 Ilab 5

    • 363 Words
    • 2 Pages

    0,counter=0; do { Console. Write("Enter Player's Name (Q to quit): "); player[counter] = Console. ReadLine(); if (player[counter] == "q" || player[counter] = = "Q") { addName = 1; } else…

    • 363 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    This is our first individual assignment for Programming unit this semester. This assignment was given in December 2013, and submission date is on 10th February 2014.…

    • 1859 Words
    • 8 Pages
    Good Essays
  • Better Essays

    Nt1310 Unit 1 Assignment

    • 1994 Words
    • 8 Pages

    * The binary numbering system plays a central role in how information of all kinds is stored on the computer. Understanding binary can lift a lot of the mysteries from computers because at a fundamental level they're really just machines for flipping binary digits on and off. There are several activities on binary numbers in this document, all simple enough that they can be used to teach the binary system to anyone who can count! Generally children learn the binary system very quickly using this approach, but we find that many adults are also excited when they finally understand what bits…

    • 1994 Words
    • 8 Pages
    Better Essays
  • Satisfactory Essays

    Pow 6 Linear Nim Analysis

    • 656 Words
    • 3 Pages

    For this game of Linear Nim you draw 10 line marks on a piece of paper and two players take turns crossing off only 1, 2, or 3 marks per turn. The person who crosses off the last mark is the winner. Firstly what I did was play a few games with my Mom and what I realized right away was that if you stopped just before the last four dashes in the game then you would always win. Since you aren’t always guaranteed of being the one who can put these dashes on the sixth line then I had to think of a strategy. So I thought of a way to make it so I would be able to get the sixth dash as long as I started first. I found that starting with two lines crossed off would leave my mom with only one, two or three dashes that would give me the opportunity to get the sixth line no matter which number of lines she crossed off. I used this many times on her and it seemed to be undefeatable. When she went first and didn’t start with three I would try to get the six, which would make me win. Such as if she started with three then I would cross off three and I would get the six forcing her to lose.…

    • 656 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    It210 Appendix F

    • 372 Words
    • 3 Pages

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 372 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    Unit 22 Asseement

    • 1496 Words
    • 6 Pages

    |Unit Title: |Unit Number: | |Developing computer games |22 | |Level of Award: 3 |Centre Number: 16405 | |Candidate Name: |Candidate Number: | |Learning Hours: 60 |Duration of Academic Year: 1 Term | |Unit Deadline: | |Assignment Brief Author: Mr Badhasha | |Tutor/Assessor | |Signed: |Date: | |Final Grade: |Date: | |Assignment Internal Verifier: | |Signed: |Date: | |Tutor/Assessor Comments: | |…

    • 1496 Words
    • 6 Pages
    Better Essays
  • Powerful Essays

    EAS230Syllabus

    • 1748 Words
    • 8 Pages

    An introduction to computer programming with an emphasis on problem solving will be presented. Specific topics include:…

    • 1748 Words
    • 8 Pages
    Powerful Essays
  • Satisfactory Essays

    Lab 7 Student

    • 1242 Words
    • 7 Pages

    This lab accompanies Chapter 5 (pp. 163-183 and pp. 196-201) of Starting Out with Programming Logic & Design.…

    • 1242 Words
    • 7 Pages
    Satisfactory Essays
  • Good Essays

    Info1105

    • 951 Words
    • 4 Pages

    For this assignment, you will need to implement a linked list that maintains its elements in sorted order. For example, inserting , , (in that order) into a regular linked list would look like this: However, if the list maintained a sorted order, it would look like this:…

    • 951 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    IT Level 3

    • 1133 Words
    • 6 Pages

    The program tells us how to multiply the numbers that are put above, e.g. found coins = 20, magic coins =10 and stolen coins =3 which are from lines 1-3 and line 4 shows us a question which consists of those numbers. Line 5 shows us that stolen coins value is now 2 instead of 3 and line7 shows us that magic coins has also changed its value from 10 to 13.…

    • 1133 Words
    • 6 Pages
    Satisfactory Essays
  • Better Essays

    Disc Golf

    • 1086 Words
    • 5 Pages

    Tee off order on the first tee will be by mutual arrangement or by flipping discs. The printed side is heads and the odd man should be first. Tee off order on all subsequent holes is determined by the score on the previous hole. The player with the lowest score tees off first.…

    • 1086 Words
    • 5 Pages
    Better Essays