0% found this document useful (0 votes)
66 views11 pages

Oop Mocroproject Final

The document describes a project to create a Tic-Tac-Toe game using C++. It includes an introduction to the game, hardware and software requirements, a project plan and schedule, an overview of how the system will be implemented through coding and testing, the program code for the game logic and functions, and an acknowledgment section thanking those involved in the project.

Uploaded by

Pranav Wadge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views11 pages

Oop Mocroproject Final

The document describes a project to create a Tic-Tac-Toe game using C++. It includes an introduction to the game, hardware and software requirements, a project plan and schedule, an overview of how the system will be implemented through coding and testing, the program code for the game logic and functions, and an acknowledgment section thanking those involved in the project.

Uploaded by

Pranav Wadge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

TIC-TAC-TOE USING

C++

SUBMITTED BY

Laxmi sanas Enrollment No :2105300302


Priyanka Mahale Enrollment No:2105300305
Riya Kathe Enrollment No :2105300289
Priyanka vadje Enrollment No: 2205300381

Project Guided by

PROF.SNEHAL PAGARE

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION, Mumbai

Mahavir Polytechnic, Nashik.(0530)


DEPARTMENT OF COMPUTER ENGINEERING
(2022-2023)

1
MAHAVIR POLYTECHNIC, NASHIK.

DEPARTMENT OF COMPUTER ENGINEERING

CERTIFICATE
This is to certify that the Micro Project Report on “tic-tac-toe using c++ ” is
satisfactorily completed and submitted in the partial fulfillment of the requirement for
Subject "Data structure using c” in second year Computer Engineering in Semestet
third of Academic Year 2022-2023

By

Laxmi Sanas
Priyanka Mahale
Riya Kathe
Priyanka vadje

PROF.SNEHAL PAGARE PROF. A.D.SONAWANE PROF.S.V.SAGRE

(Project Guide) (H.O.D.) (Principal)

2
ACKNOWLEDGEMENT

I take this opportunity to thank all those who have contributed in successful
completion of this Micro Project work. I would like to express my sincere thanks to
my PROJECT GUIDE BY PROF.SNEHHAL PAGARE MAM who has encouraged me to
work on this project and guided me whenever required.

We also would like to express our gratitude to our H.O.D. PROF. A.D.SONAWANE
for giving us opportunities to undertake this project work at Mahavir Polytechnic,
Nashik.

We are extremely grateful to our PRINCIPAL PROF. S.V.SAGRE for his constant
inspiration and keen interest to make the project and presentation absolutely
flawless.

At the last but not the least we would like to thank our Teaching staff member,
Workshop staff member, Friends and family member for their timely co-operation
and help.

Miss. LAXMI A.SANAS


Enrollment No. 2105300302

Miss.priyanka Mahale
Enrollment No. 2105300305

Miss. Riya Kathe


Enrollment No. 2105300289

Miss.priyanka vadje
Enrollment No. 2205300381

S.Y.C.O.
Academic Year 2022-2023
Third Semester

3
 INDEX

SR. NO. TOPIC PAGE NO.

1  Introduction 5

2  Requirement analysis

2.1 Hardware Requirements 6

2.2 Software Requirements


3
 Project planning
3.1 6
Schedule Estimation(s/w  &
h/w)Project Plan
3.2
4
 System implementation 7
4.1
5 Program Code
7,8,9,10
5.1 Output

 Application and feature scope


6
 Conclusion 10
6.1
 Reference
6.2

4
 INTRODUCTION

Creating a Tic Tac Toe game in C++ is easy. We can create a two-player Tic
Tac Toe game in C++ language using Array, Function, and True-False condition.Tic-
tac-toe is a game where two players X and O fill the hash (#) shaped box (consist of
two vertical lines crossing two horizontal lines) with their alternate turns. The player
who first fills the box with 3Xs or 3Os in a horizontal, vertical, or diagonal manner
will win the game. In some cases, when none of the players succeeds in filling the
boxes horizontally, vertically, or diagonally with 3Xs or 3Os, then the game will be
considered to be a draw.

(major resources like raw material, tools, software etc.)

Name of
S. No. Specifications Qty Remarks
Resource/material

1 Software Turboc++ 1

2 Ram 1 GB 1

3 Hard disk 32 GB 1

4 Processor 1.4GHz 64 bit 1

5 Operating system Windows 7 1

Hardware Requirements:-
5
I. Ram = 8GB
II. Hard Disk =32GB
III. Processor = 1.4GHz 64 bit

Software Requirements:-

I. Windows 7
● Project Planning

Action Plan :- (Sequence and time required for major activities for 8 Weeks)

Planned Name of
Planned
Sr. No. Details of activity Finish Responsible
Start date
date Team Members
Search micro project

name
Final micro project

name
Search information

about our project
Study about Micro

project Information
 Coding
 Testing
Power point
 presentation of
micro project
Report of micro

project
 Submission of report

 SYSTEM IMPLEMENTATION
You probably already know how to play Tic-Tac-Toe. It's a really simple
game, right? That's what most people think. But if you really wrap your brain around
it, you'll discover that Tic-Tac-Toe isn't quite as simple as you thinkTic-Tac -Toe

6
(along with a lot of other games) involves looking ahead and trying to figure out what
the person playing against you might do next.

 Program Code

#include <iostream>
using namespace std;

char square[10] = {'o','1','2','3','4','5','6','7','8','9'};

int checkwin();
void board();

int main()
{
int player = 1,i,choice;
char mark;
do
{
board();
player=(player%2)?1:2);
cout << "Player " << player << ", enter a number: ";
cin >> choicce;
mark=(player == 1) ? 'X' : 'O';

if (choice == 1 && square[1] == '1')


square[1] = mark;
else if (choice == 2 && square[2] == '2')
square[2] = mark;

else if (choice == 3 && square[3] == '3')


square[3] = mark;

else if (choice == 4 && square[4] == '4')


square[4] = mark;

else if (choice == 5 && square[5] == '5')


square[5] = mark;

else if (choice == 6 && square[6] == '6')


square[6] = mark;

else if (choice == 7 && square[7] == '7')


square[7] = mark;

else if (choice == 8 && square[8] == '8')

7
square[8] = mark;

else if (choice == 9 && square[9] == '9')


square[9] = mark;

else
{
cout<<"Invalid move ";
player--;
cin.ignore();
cin.get();
}
i=checkwin();
player++;
}while(i==-1);
board();
if(i==1)
{
cout<<"==>\aPlayer "<<--player<<" win ";
else
cout<<"==>\aGame draw";
cin.ignore();
cin.get();
return 0;
}

/*********************************************
FUNCTION TO RETURN GAME STATUS
1 FOR GAME IS OVER WITH RESULT
-1 FOR GAME IS IN PROGRESS
O GAME IS OVER AND NO RESULT
**********************************************/

int checkwin()
if (square[1] == square[2] && square[2] == square[3])

return 1;
else if (square[4] == square[5] && square[5] == square[6])

return 1;
else if (square[7] == square[8] && square[8] == square[9])

return 1;
else if (square[1] == square[4] && square[4] == square[7])

return 1;
else if (square[2] == square[5] && square[5] == square[8])

8
return 1;
else if (square[3] == square[6] && square[6] == square[9])

return 1;
else if (square[1] == square[5] && square[5] == square[9])

return 1;
else if (square[3] == square[5] && square[5]

else if (square[3] == square[5] && square[5] == square[7])

return 1;
else if (square[1] != '1' && square[2] != '2' && square[3] != '3'
&& square[4] != '4' && square[5] != '5' && square[6] != '6'
&& square[7] != '7' && square[8] != '8' && square[9] != '9')

return 0;
else
return -1;
}

/*******************************************************************
FUNCTION TO DRAW BOARD OF TIC TAC TOE WITH PLAYERS MARK
********************************************************************/

void board()
{
system("cls");
cout << "\n\n\tTic Tac Toe\n\n";

cout << "Player 1 (X) - Player 2 (O)" << endl ;

cout << "Player 1 (X) - Player 2 (O)" << endl << endl;
cout << endl;

cout << " | | " << endl;


cout << " " << square[1] << " | " << square[2] << " | " << square[3] << endl;

cout << "_____|_____|_____" << endl;


cout << " | | " << endl;

cout << " " << square[4] << " | " << square[5] << " | " << square[6] << endl;

cout << "_____|_____|_____" << endl;

9
cout << " | | " << endl;

cout << " " << square[7] << " | " << square[8] << " | " << square[9] << endl;

cout << " | | " << endl << endl;


}

/*******************************************************************
END OF PROJECT
********************************************************************

OUTPUT

 APPLICATIONS AND FUTURE SCOPE


A simple game like tic-tac-toe can be a mirror of how people move
through obstacles and handle decisions in life. It also shows you that the pluses

10
outweigh the minuses and that you learn how to develop strategies to help you pull
through. It's these kinds of life lessons that you would want to share to your children.
The game of tic-tac-toe is a game of predictability. The moves that are believed
to be important are highly predictable. This also makes it a game of opposites in a
way, because this goes against the definition of an “important move”. But this
predictability is what helps foster strategic thinking in children. They can learn
through observation what their opponents’ next move is and think ways on how to
block them, a simple but effective version of chess. In order to figure out what else
they can do in the game to win, the children are encouraged to think more logically.
They, therefore, naturally develop their logico-mathematical thinking, which can help
them in subjects such as math and engineering in the future.

 CONCLUSION
We have successfully completed it. In our project we have create tic-
tac-toe game application using C++. This application very useful to children.

 REFERENCES
1)www.google.com: using This website we are study of project code.
2)visit a w3school.com and search about information of project

11

You might also like