Professional Documents
Culture Documents
C++ MicroProject
C++ MicroProject
C++ MicroProject
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]
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.
2.0 Aim of the Micro-Project
This Micro-Project aims at :
1. To apply artificial intelligence in our program.
2. To check the combination whether any two symbols(X or O) are same for winning
or blocking .
3. To create scope for computer to win in the third move.
3.0 Action Plan
S. No. Details of activity Planned Planned Name of Responsible
Start date Finish Team Members
date
9 Discuss with the subject teacher regarding
the concept of “micro-project” which include 2/10/2022 2/10/2022 Mohit Khandale
in the I scheme.
10 Discuss with the subject teacher how to write
a diary and report of micro-project. 5/10/2022 5/10/2022 Sahil Gaikwad
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;
/*******************************************************************
END OF PROJECT
********************************************************************/
Output:
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.
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.
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………………………………………………………………………………………
…...