Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Project Report on

Tic Tac Toe Game using C


Course Code: CSE 100

Supervisor
Professor Dr. A H M Kamal
Professor, Department of Computer Science & Engineering
Jatiya Kabi Kazi Nazrul Islam University

Submitted by
Name : Jarin Sultana Smrity
Session : 2019-2020
Roll : 20102009
Reg : 8840
Department of Computer Science & Engineering
Jatiya Kabi Kazi Nazrul Islam University

Name : Rakibun Nabi


Session : 2019-2020
Roll : 20102037
Reg : 8868
Department of Computer Science & Engineering
Jatiya Kabi Kazi Nazrul Islam University

Submission Date : 24.03.2022


Declaration
I hereby declare that the project entitled “Tic Tac Toe Game” is submitted in
partial fulfillment of the requirements for “Software Development Project-I” is
my own work and it contains no material which has been copied from other,
except where due reference is made in the report.

With Best Regards,

——————————————– ——————————————–

Jarin Sultana Smrity Rakibun Nabi


Roll : 191013 Roll : 20102037
Reg : 8840 Reg : 8868
Session : 2019-2020 Session : 2019-2020

Dept. of Computer Science and Dept. of Computer Science and


Engineering Engineering
Jatiya Kabi Kazi Nazrul Islam Jatiya Kabi Kazi Nazrul Islam
University University
Trishal, Mymensingh. Trishal, Mymensingh.
Approval

The project “Tic Tac Toe ” is submitted by Jarin Sultana Smrity, Session: 2019-
20, Roll: 20102009 and Rakibun Nabi, Session: 2019-20, Roll: 20102037 under
the supervision of Professor Dr. A.H.M. Kamal, Department of Computer
Science and Engineering has been accepted as satisfactory for the partial
fulfillment of the requirements for “Software Development Project-I”

Approval of :

Supervisor : . . . . . . . . . . . . . . . . . .
Professor Dr. A.H.M. Kamal
Professor, Department of Computer Science and Engineering
Jatiya Kabi Kazi Nazrul Islam University
Trishal, Mymensingh.
Abstract
The aim of this project is to develop our skill in C language. The tic-
tac-toe game is played on a 3x3 grid the game is played by two
players, who take turns. The first player marks move with a circle,
the second with a cross. The player who has formed a horizontal,
vertical, or diagonal sequence of three marks wins. Your program
should draw the game board, ask the user for the coordinates of the
next mark, change the players after every successful move, and
pronounce the winner.
Contents

Topic
1
Introduction
1.1 Introduction
1.2 Background Studies
1.3 Objective
1.4 Devloping The System:
2
Implementation
2.1 Introduction:

3
Result And Discussion
3.1 Introduction:
3.2 Experimental Output:
3.3 Limition Of this Project:

3.4 Conclusion
Chapter 1

Introduction

1.1 Introduction:

Software is a collection of data or computer instructions that tell the computer how to
work.
In other words, software’s all information processed by computer systems, programs and
data.
The term program refers to any piece of software.

In addition to, software is a general term for the various kinds of programs used to
operate computers and related devices. Software can be thought of as the variable part of a
computer and hardware the invariable part. Software is often divided into application
software (programs that do work users are directly interested in) and software (which
includes operating system and any program that supports application software). The term
middleware is sometimes used to describe programming that mediates between application
and system software or between two different kinds of application software (for example,
sending a remote work request from an application in a computer that has one kind of
operating system to an application in a computer with a different operating system).

An outline (algorithm) for what would have been the first piece of software was written
by Ada Lovelace in the 19th century, for the planned Analytical Engine. She created proofs
to show how the engine would calculate Bernoulli Numbers. Because of the proofs and the
algorithm, she is considered the first computer programmer.

The first theory about software—prior to the creation of computers as we know them
to-day—was proposed by Alan Turing in his 1935 essay On Computable Numbers, with an
application to the entscheidungsproblem (decision problem).

In 2000, Fred Shapiro, a librarian at the Yale Law School, published a letter revealing that
John Wilder Tukey’s 1958 paper “The Teaching of Concrete Mathematics” contained the
ear-list known usage of the term “software” found in a search of JSTOR’s electronic archives,
predating the OED’s citation by two year’s. This led many to credit Tukey with coining the
term, particularly in obituaries published that same year, although Tukey never claimed
credit for any such coinage. In 1995, Paul Niquette claimed he had originally coined the term
in October 1953, although he could not find any documents supporting his claim. The
earliest known publication of the term “software” in an engineering context was in August
1953 by Richard R. Carhart, in a Rand Corporation Research Memorandum.
Software can be of 3 types,
1. Application software:
Which is software that uses the computer system to perform special functions or pro-
vide entertainment functions beyond the basic operation of the computer itself. There
are many different types of application software, because the range of tasks that can
be performed with a modern computer is so large.
2. System software:
Which is software for managing computer hardware behavior, as to provide basic
functionalities that are required by users, or for other software to run properly, if at
all. System software is also designed for providing a platform for running application
software.
3. Malicious software or malware:
Which is software that is developed to harm and disrupt computers. As such, malware
is undesirable. Malware is closely associated with computer-related crimes, though
some malicious programs may have been designed as practical jokes.
Software is usually designed and created (aka coded/written/programmed) in integrated
development environments (IDE) like Eclipse, IntelliJ and Microsoft Visual Studio that can
simplify the process and compile the software. Software is usually created on top of existing
software and the application programming interface (API) that the underlying software pro-
vides like GTK+, JavaBeans or Swing. Libraries (APIs) can be categorized by their purpose.
Data structures such as hash tables, arrays, and binary trees, and algorithms such as
quicksort, can be useful for creating software.

A person who creates software is called a programmer, software engineer or software


developer, terms that all have a similar meaning. More informal terms for programmer also
exist such as “coder” and ”hacker” – although use of the latter word may cause confusion,
because it is more often used to mean someone who illegally breaks into computer systems.

1.2 Background Studies:

C is a general-purpose, procedural computer programming language supporting structured


programming, lexical variable scope, and recursion, while a static type system prevents
unintended operations. By design, C provides constructs that map efficiently to
typical machine instructions and has found lasting use in applications previously coded
in assembly language. Such applications include operating systems and various application
software for computers, from supercomputers to embedded systems.

C was originally developed at Bell Labs by Dennis Ritchie between 1972 and 1973 to make
utilities running on Unix. Later, it was applied to re-implementing the kernel of the Unix
operating system. During the 1980s, C gradually gained popularity. It has become one of
the most widely used programming languages, with C compilers from various vendors
available for the majority of existing computer architectures and operating systems. C has
been standardized by the ANSI since 1989 and by the International Organization for
Standardization.
C has facilities for structured programming and allows lexical variable scope and recursion.
Its static type system prevents unintended operations. In C, all executable code is contained
within subroutines . Function parameters are always passed by value. Pass-by-reference is
simulated in C by explicitly passing pointer values. C program source text is free-format,
using the semicolon as a statement terminator and curly braces for grouping blocks of
statements.

1.3 Objective:

First of all, you start with a 3X3 grid which is nine squares. You also have X pieces and you
have O pieces. This game can only be played with two players. Each player chooses whether
they want to have the X pieces or O pieces. Once this happens the player with the X’s will
start his turn. A turn consists of a player laying his piece down on any unoccupied square on
the grid. Now the player with the O’s will place his piece. Then the power returns to the
player with the X’s. This happens until the objective of the game is reached which is to make
a straight line of three of your pieces on the board such as this XXX or OOO. If there is a
straight line but for instants the opponent’s piece was in there, that would not be a win:
XOX. You can get a straight line vertically, horizontally, and diagonally. If it comes to a point
where the opponent can win on the next turn then you must place a piece to block the
player from doing that movement. Once you get a straight line you win. Otherwise, it will be
a draw.

1.4 Developing the System:

The name our course is Software Development Project-I. Software development is a process
by which stand alone or individual. Software is created using a specific programming
language. It involves writing a series of interrelated programming code, which provides the
functionality of the developed software. Software development may also be called
application development and software design.
There are some steps for software development:

There are some steps for software development:


i. Analyzing the problem
ii. Market research
iii. Gathering requirements for the proposed business solution
iv. Devising a plan or design for the software-based solution
v. Implementation (coding) of the software
vi. Testing the software
vii. Deployment
viii. Maintenance and bug fixing
These stages are often referred to collectively as the software development lifecycle, or
SDLC.

There are many aspects to consider in the design of a piece of software. The importance
of each consideration should reflect the goals and expectations that the software is being
created to meet. Some of these aspects are:
Compatibility - The software is able to operate with other products that are
designed for interoperability with another product. For example, a piece of software
may be backward-compatible with an older version of itself.

Extensibility - New capabilities can be added to the software without major changes to
the underlying architecture.

Modularity - the resulting software comprises well defined, independent components


which leads to better maintainability. The components could be then implemented
and tested in isolation before being integrated to form a desired software system. This
allows division of work in a software development project.

Fault-tolerance - The software is resistant to and able to recover from component

failure. Maintainability - A measure of how easily bug fixes or functional modifications

can be accomplished. High maintainability can be the product of modularity and

extensibility.

Reliability (Software durability) - The software is able to perform a required function


under stated conditions for a specified period of time.

Reusability - The ability to use some or all of the aspects of the preexisting software in
other projects with little to no modification.

Robustness - The software is able to operate under stress or tolerate unpredictable or


invalid input. For example, it can be designed with resilience to low memory
conditions.

Security - The software is able to withstand and resist hostile acts and influences.

Usability - The software user interface must be usable for its target user/audience. De-
fault values for the parameters must be chosen so that they are a good choice for the
majority of the users.

Performance - The software performs its tasks within a time-frame that is acceptable
for the user, and does not require too much memory.

Portability - The software should be usable across a number of different conditions


and environments.

Scalability - The software adapts well to increasing data or number of users.

A software designer or architect may identify a design problem which has been visited and
perhaps even solved by others in the past. A template or pattern describing a solution to a
common problem is known as a design pattern. The reuse of such patterns can help speed
up the software development process.
Chapter 2

Implementation

Introduction:

Implementation refers to the construction of the proposed system with the specified design
in a procedural manner. In this part of the report we are going to talk about the
implementation of the System and how we did it.

Here we implement the concept of our game. First we made the structure of game with
two dimensional array .Then we mark the move of player one after another one of them use
X and other use O. If only three move of a player are lined up in a straight line he win.
Otherwise the game will call a draw.
Chapter 3

Result and Discussion

3.1 Introduction:

In this software, the main objective is to create Tic Tac Toe Game. After finishing all the
procedures we are successful to finish our project. In the project all the input and output are
working correctly. Hence our goal of running the program has succeed.

3.2 Experimental Output:

(1) Rules (2)Game (3)Exit

Figure 3.1: Welcome window


Figure 3.2: Rules of Game

Figure 3.3: Tic Tac Toe Game


Figure 3.4: Exit Game

Figure 3.5: Winner declaration when someone wins

Figure 3.6: Calling draw when no one wins


Figure 3.7: When put an invalid move

3.3 Limitation Of this Project:

1. Its two player Tic Tac Toe so two player needed to play the game.

2. Most of the time the game will be a draw.

3. It can only take integer type input.


3.4 Conclusion:
The software development project 1 taught us about programming and the making of game
Tic Tak Toe for an engineering project. At the beginning the game logic and code seems
pretty hard but everything went well with our teamwork. The game was successful. We are
happy with the outcome of this project and the functioning tic-tac-toe game we created.

Bibliography:

1. @book author = E.Balagurusamy, title = Programming in ANSI C, edition =


Sixth Edition,
2. @online https://en.wikipedia.org/wiki/Software
3. @online https://en.wikipedia.org/wiki/Tic-tac-toe

You might also like