Professional Documents
Culture Documents
C++ MicroProject Final
C++ MicroProject Final
EDUCATION – MUMBAI
A
Micro-Project Report On
“Tic Tack Toe”
Submitted by,
Mohit Khandale [11]
Anurag Mhaske [29] Sahil Gaikwad [50]
Guided by,
Prof. P.M.Takate,
Lecturer,
Department of Information Technology
Academic Year
2022-23
MET’S INSTITUTE OF TECHNOLOGY - POLYTECHNIC
BHUJBAL KNOWLEDGE CITY, ADGAON, NASHIK
MET’s Institute of Technology, Polytechnic
Bhujbal Knowledge City,
Adgaon, Nashik-422 003
Tel.: ( 0253)2303515, 2303267, 2303268 Telefax : ( 0253 )2303305,
Toll-free: 1800 22 0234 Email:principal_iot@bkc.met.edu
CERTIFICATE
This is to Certify that this report,
“Tic Tack Toe”
Submitted by,
Mohit Khandale [11]
Anurag Mhaske [29] Sahil Gaikwad [50]
We take this opportunity to express our deepest sense of gratitude and sincere thanks
to those who have helped us in completing this task.
We express our sincere thanks to our Project Guide Prof. P.M.Takate , Information
Technology Department, who has given us excellent guidance, continuous Encouragement
for the completion of this work. His kind assistance and constant inspiration will always help
us in our future also.
We are very thankful to Principal. Dr. R.S. Narkhede, for encouraging us to
undertake this project and he has taken keen interest in making the project and report
absolutely flawless.
We are very thankful to Prof. S.B.Patil , for encouraging us to undertake this project
and he has taken keen interest in making the project and report absolutely flawless.
Annexure –I A
PART A - Plan
“Tic Tack Toe”
1.0 Brief Introduction
1. Our project name is Tic-Tac-Toe game. This game is very popular and is fairly simple by
itself. It is actually a two player game. In this game, there is a board with n x n squares. In
our game, it is 3 x 3 squares.
2. The goal of Tic-Tac-Toe is to be one of the players to get three same symbols in a row -
horizontally, vertically or diagonally - on a 3 x 3 grid.
**************
Annexure –II A
PART B
“Tic Tack Toe”
1.0 Brief Introduction
1. Our project name is Tic-Tac-Toe game. This game is very popular and is fairly simple by
itself. It is actually a two player game. In this game, there is a board with n x n squares. In
our game, it is 3 x 3 squares.
2. The goal of Tic-Tac-Toe is to be one of the players to get three same symbols in a row -
horizontally, vertically or diagonally - on a 3 x 3 grid.
**************
Program Code:
#include<iostream.h>
#include<conio.h>
int checkwin();
void board();
int main()
{
int player = 1,i,choice;
clrscr();
char mark;
do
{
board();
player=(player%2)?1:2;
cout << "Player " << player << ", enter a number: ";
cin >> choice;
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')
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)
cin.ignore();
cin.get();
return 0;
getch();
}
/*********************************************
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])
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] == 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 << endl;
cout << endl;
cout << " " << square[4] << " | " << square[5] << " | " << square[6] << endl;
cout << " " << square[7] << " | " << square[8] << " | " << square[9] << endl;
7 Report Preparation
8 Presentation
9 Defense
Micro-Project Evaluation Sheet
Note:
Every course teacher is expected to assign marks for group evolution in first 3
columns & individual evaluation in 4TH columns for each group of students as
per rubrics.
Name and designation of the Faculty Member: Prof. P.M.Takate and Lecturer
Signature………………………………………………………………………………………
…...
Teacher Evaluation Sheet
7 Report Preparation
8 Presentation
9 Defense
Micro-Project Evaluation Sheet
Note:
Every course teacher is expected to assign marks for group evolution in first 3
columns & individual evaluation in 4TH columns for each group of students as
per rubrics.
Name and designation of the Faculty Member: Prof. P.M.Takate and Lecturer
Signature………………………………………………………………………………………
…...
Teacher Evaluation Sheet
7 Report Preparation
8 Presentation
9 Defense
Micro-Project Evaluation Sheet
Note:
Every course teacher is expected to assign marks for group evolution in first 3
columns & individual evaluation in 4TH columns for each group of students as
per rubrics.
Name and designation of the Faculty Member: Prof. P.M.Takate and Lecturer
Signature………………………………………………………………………………………
…...