The Creation Of Tic Tac Toe Game Using The C/C++ Language, Includes Full Code Of The Actual Program

2926 words - 12 pages

IntroductionThis 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.AimsTo 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.ResultsWhen 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" appears. Mark goes first and enters in a row number followed by a column number, the computer checks to see if the space is occupied or not, if the box is occupied then "please enter a valid move" appears (See problems part). If the box is not occupied then the computer displays a new board with an "X" in the appropriate box and "Trevor please enter the row number and press enter" appears.Before "Trevor please enter the row number and press enter" the computer checks for another win or draw and then prints the printf statement. Trevor enters his row and column, the computer checks to see if it is a valid move, then displays the "O" in the appropriate box. The computer then prompts Mark to take his go after checking for a win or a draw..This sequence of events continues to occur until either there is a win by one of the two players or a draw. When a win or a draw occurs then the comparer prints out "Player "X" wins Mark is far superior than Trevor" or "Player "O" wins. Trevor is far superior than...

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

Classification of the hourly solar radiation using c-means algorithm for optimal stand-alone PV system sizing

704 words - 3 pages embedding dimension [37]. This method determines the nearest neighbour of every point in a given dimension, and then checks if there are still close neighbours in the higher dimension. After determining the optimal embedding dimension, the reconstructed phase space of the solar radiation data is clustered using the fuzzy c-means algorithm. In this method, as in the fuzzy logic approach, each point belongs to a cluster with some degree of

Classification of the hourly solar radiation using c-means algorithm for optimal stand-alone PV system sizing

1682 words - 7 pages radiation (i.e. 1000 W/m2), is the temperature coefficient is between (0.004-0.006), is the cell temperature in °C and is the reference temperature of the panel (generally equal to 25 °C with air mass AM= 1.5). (9) (10) Where, is the maximum battery useful capacity in (Wh), is the number of batteries, is voltage for the unity of storage, is the nominal battery capacity in (Ah) and is the maximum depth of discharge. The

What relationships are explored in section C of the anthology and how do the writers use language to convey these relationships to the reader?

2328 words - 10 pages , powerful diction, imagery and informal tone which make it sound like a stream of though. Using irregular line breaks, Walker emphasizes words that she desires attention drawn upon by placing one significant word in each line. Such as she uses irregular line breaks to emphasise the words ‘cooked’ ‘dancing’ ‘yoga’ ‘voluptuous’ and ‘food’ here the word voluptuous comes as a surprise since most of the language is deliberately plain and

Information Processing Technology - how to creat a game or program. its the code on a card game

744 words - 3 pages New Game·Code for the New game Button:Private Sub cmdNew_Click ()Static Occupied (1 To 2)Random picBox = True "Random the Picture box after new game"PicCover. Invisible = true" For picBox # 1 and 2"Set win label = 0' update number of win for new gameSet loss label = 0' update number of loss for new gameEnd Sub·Code to activate a covering card when it's clicked on:Private Sub picCover_Click (Index As Integer)Static First picBox as

Using two recent advertisements (in the same medium) for different brands in the same product/service category: 1) Explain how they differ regarding c

1402 words - 6 pages their 2013 Christmas advert in which they use the seasonal theme of snowmen to “attack rivals on price”(The Guardian 2013). They do this by using 4 snowmen with yellow, blue and orange scarfs to represent Morrisons, Tesco and Sainsbury’s all of which look sad, thin and small. The 4th snowman has a green scarf to represent ASDA and this snowman looks happy and is far taller than the other 3. The connotations of this are that people will see ASDA

Stacks in C++ (this stack is using linked structure)

1095 words - 4 pages /********************************************************************* file: stack.cpp ** desc: C++ assignment ** Author: Syed R Fayyaz ** Date: 03-30-2004 ** ** Comment: To introduce with the concept of PUSH, pop and display **with stacks. Stack is implemented using linked structure**which is little difficult from array ADT's but good for **polishing programming skills

Journal Article Review on Using Psychological Skills Training to Develop Performance by Richard C. Thelwell

2019 words - 9 pages Review of Journal Article: Using Psychological Skills Training to Develop Soccer Performance Richard C. Thelwell , Iain A. Greenlees & Neil J. V. Weston (2006) Using Psychological Skills Training to Develop Soccer Performance, Journal of Applied Sport Psychology,18:3, 254-270 Improving the performances of athletes has always been of utmost importance to many stakeholders of the sporting industry, such as the athletes’ coaches, sport

The Legacy of Matthew C. Perry

925 words - 4 pages Legacy of Matthew C. Perry Can the diplomatic strategy of the United States be affected by the possibility of the North Korean government, under the leadership of Kim Jong Un, systematically causing the death of millions of North Korean citizens? As Senior Enlisted leaders, it is of the upmost importance to keep the history, heritage, and traditions of the respective branches of service alive, and to share the relevance with all service members

The Mathematical art of M. C. Escher

1597 words - 6 pages half he or she is looking down. To emphasize what he has accomplished, Escher has made the top and bottom halves depictions of the same composition.A third type of "impossible drawing" relies on the brain's insistence upon using visual clues to construct a three-dimensional object from a two-dimensional representation, and Escher created many works which address this type of anomaly.One of the most intriguing is based on an idea of the

The theme of freedom versus. c

1285 words - 5 pages should be no control in our society, but Antonio and Sebastian mock him.Antonio is a character in The Tempest who has acquired control by usurping Prospero's throne. He proposes a murderous plot to Sebastian: he will kill Alonso so that Sebastian can become king, and Sebastian must also kill Gonzalo. By using powers of persuasion, Antonio is a character that has gained control. Antonio has no conscience and as long as he has his own freedom, he

Lord of the Flies Literature C

1127 words - 5 pages Throughout Chapters six, seven, and eight, Golding focusing on Simon for being unique, and different from the other boys. He depicts Simon as a black sheep in which the other boy's dislike. One such example is that the other boy's are always making fun of him, and despite that, Simon never retaliates with returning verbal attacks. One big difference in Simon from the other boy's, is that Simon does not fear the beast. Simon knows that beast is

Similar Essays

Analysis Of The C++ Programming Language

1527 words - 6 pages Smalltalk (Stroustrup, 1991). It was based on the C language developed by Brian Kernighan and Dennis Ritchie used to code the UNIX operating system. In 1983, C++ was coined as the new name based on the C language increment (++) operator. Experienced C programmers would find the name "++C" more appropriate since the increment should proceed the incremented variable usage but C++ stuck. C++, as of 1998, has an ANSI /ISO standard (NCITS, 1998).Building

The Evolution Of C++ As A Programming Language

2137 words - 9 pages , different kinds of data types and expressions, and commands, which manipulate that data. Code is split up into sections called blocks, made up of one or more definitions and one or more commands, which was a feature directly drawn from Algol. Numerical and non-numerical data types were referenced through index registers using names, either a single lower-case character or a series of upper-case alphanumeric characters. Basic symbols of the language

Polymorphism In The C Programming Language

819 words - 3 pages Polymorphism in The C Programming Language The problem is that we need to compress our programs while still having them function correctly and process items differently depending on type or class. The solution is polymorphism. Polymorphism in object oriented programming is the programming language's ability to process items differently depending on their data type or class. In other words, it is the ability to redefine methods for derived

A Comprehensive Look At The Development Of The Computer Programming Language, Focusing Partially On C++

1908 words - 8 pages used to program some of the most popular games in recent years. Much of the credit from the award winning game Counter Strike can be given to the language of C++. It is because of the ability to track and control hundreds of instances, such as gunfire and running characters, that C++ was the practical choice for this game. In PC applications, C++ has been used in everything from the Operating System (OS), to the basic word processor; C++ offers