A MICRO PROJECT REPORT
On
“Tic Tac Toe Game”
Is Submitted by
Miss. Jadhav Payal Rohidas. (2215320013)
Miss. Chavan Manasi Tukaram. (2215320067)
Miss. Harane Prajakta Dhanaji. (2215320008)
Miss. Shinde Janhavi Jalindar. (2215320009)
Under the guidance of
Prof Sonavane
Subject:- GUD
In partial fulfilment of
Diploma in S,Y Computer Engineering
(Academic Year 2023-2024)
Maharashtra State Board of Technical Education, Mumbai
Certificate
This is to certify that following Students
Miss. Jadhav Payal Rohidas. (2215320013)
Miss. Chavan Manasi Tukaram. (2215320067)
Miss. Harane Prajakta Dhanaji. (2215320008)
Miss. Shinde Janhavi Jalindar. (2215320009)
Has successfully submitted their Micro Project report on “Tic Tac
Toe Game ” of the academic year 2023-2024 in the partial fulfilment
towards the completion of micro project in S.Y CO Engineering under
MSBTE MUMBAI
Project Guide Head of Department
Prof Sonavane P.C Prof Salunkhe A.A
ACKNOWLEDGEMENT
I am personally indebted to a number of people who gave me their useful
insights to aid in my overall progress for this project. A complete
acknowledgement would therefore be encyclopedic. First of all, I would like to
give my deepest gratitude to my parents for permitting me to take up this
course.
My heartfelt sense of gratitude goes to our respected Principal Prof.
Khopade D. K for all his efforts and administration in educating us in his
premiere institution. I take this opportunity to also thank our Head of the
Department, Prof Salunkhe A.A for her encouragement throughout the seminar.
I would like to express my sincere thanks and gratitude to my guide Prof
Pansare P.C for her commendable support and encouragement for the
completion of Project with perfection. I also convey my sincere thanks to Prof
Pansare P.C for his invaluable suggestion and for his technical support
rendered during the course of my project.
I would like to thank all faculty members and staff of the Department of
Computer
Engineering for their generous help in various ways for the guidance of this
project.
Student name Enrollment No Sign
Jadhav Payal Rohidas 2215320013
Chavan Manasi Tukaram 2215320067
Harane Prajakta Dhanaji 2215320008
Shinde Janhavi Jalindar 2215320009
INDEX
Sr. No Topic
1. Introduction
2. Methodology
3 Benefits
4. Program
5. Output
6. Conclusion
7. References
Introduction
Tic Tac Toe, also known as Noughts and
Crosses, is a timeless and universally recognized game
enjoyed by people of all ages. Its simplicity belies the
strategic depth it offers, making it a perennial favorite
for casual gamers and strategic thinkers alike.
Played on a grid of nine squares, typically
arranged in a 3x3 formation, the game involves two
players taking turns to place their symbol, usually an 'X'
or an 'O', in an attempt to form a line of three of their
symbols horizontally, vertically, or diagonally.
Despite its straightforward rules, Tic Tac Toe
encourages critical thinking, pattern recognition, and
anticipation of opponents' moves, making each match a
captivating challenge. Whether played on paper, a
chalkboard, or through digital platforms, Tic Tac Toe
continues to captivate players around the world, proving
that timeless simplicity can still offer
endless enjoyment.
Actual Methodology Followed
1. First we got the title of micro project from our subject
teacher.
2. Then we collected the information about Tic
Tac Toe
3. Then we studied different concepts and videos
related with that concept.
4. Then we type the required Part: - A and part B
5. After finishing all the typing, we arrange all the
data in proper arrangement.
7. At last, we take the printout of the micro
project and submitted to subject teacher.
Benefits :-
1. Strategic thinking: Players must anticipate their
opponent's moves and plan their own to win.
2. Critical thinking: Analyzing the board and
making decisions based on potential outcomes
helps develop critical thinking skills.
3. Problem-solving: Players must come up with
strategies to block their opponent while aiming
to win themselves.
4. Pattern recognition: Recognizing patterns on
the board helps players make informed
decisions.
5. Spatial reasoning: Understanding the layout of
the grid and how moves affect the overall
board position enhances spatial
reasoning abilities.
Program
Public Class Form1
Dim checkForXorO As Boolean = False
Dim addOneToScore As Integer = 0
Public Property LabelPlayerX As Object
Public Property LabelPlayerO As Object
Sub buttonsEnabledFalse()
Button1.Enabled = False
Button2.Enabled = False
Button3.Enabled = False
Button4.Enabled = False
Button5.Enabled = False
Button6.Enabled = False
Button7.Enabled = False
Button8.Enabled = False
Button9.Enabled = False
End Sub
Sub checkForWin()
If Button1.Text = "X" And Button2.Text = "X" And Button3.Text =
"X" Then
Button1.BackColor = Color.Black
Button2.BackColor = Color.Black
Button3.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button4.Text = "X" And Button5.Text = "X" And Button6.Text =
"X" Then
Button4.BackColor = Color.Black
Button5.BackColor = Color.Black
Button6.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button7.Text = "X" And Button8.Text = "X" And Button9.Text =
"X" Then
Button7.BackColor = Color.Black
Button8.BackColor = Color.Black
Button9.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button1.Text = "X" And Button4.Text = "X" And Button7.Text =
"X" Then
Button1.BackColor = Color.Black
Button4.BackColor = Color.Black
Button7.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button2.Text = "X" And Button5.Text = "X" And Button8.Text =
"X" Then
Button2.BackColor = Color.Black
Button5.BackColor = Color.Black
Button8.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button3.Text = "X" And Button6.Text = "X" And Button9.Text =
"X" Then
Button3.BackColor = Color.Black
Button6.BackColor = Color.Black
Button9.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button1.Text = "X" And Button5.Text = "X" And Button9.Text =
"X" Then
Button1.BackColor = Color.Black
Button5.BackColor = Color.Black
Button9.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button3.Text = "X" And Button5.Text = "X" And Button7.Text =
"X" Then
Button3.BackColor = Color.Black
Button5.BackColor = Color.Black
Button7.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerX.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button1.Text = "O" And Button2.Text = "O" And Button3.Text =
"O" Then
Button1.BackColor = Color.Black
Button2.BackColor = Color.Black
Button3.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerO.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button4.Text = "O" And Button5.Text = "O" And Button6.Text =
"O" Then
Button4.BackColor = Color.Black
Button5.BackColor = Color.Black
Button6.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerO.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button7.Text = "O" And Button8.Text = "O" And Button9.Text =
"O" Then
Button7.BackColor = Color.Black
Button8.BackColor = Color.Black
Button9.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerO.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button1.Text = "O" And Button4.Text = "O" And Button7.Text =
"O" Then
Button1.BackColor = Color.Black
Button4.BackColor = Color.Black
Button7.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerO.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button2.Text = "O" And Button5.Text = "O" And Button8.Text =
"O" Then
Button2.BackColor = Color.Black
Button5.BackColor = Color.Black
Button8.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerO.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button3.Text = "O" And Button6.Text = "O" And Button9.Text =
"O" Then
Button3.BackColor = Color.Black
Button6.BackColor = Color.Black
Button9.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button1.Text = "O" And Button5.Text = "O" And Button9.Text =
"O" Then
Button1.BackColor = Color.Black
Button5.BackColor = Color.Black
Button9.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button3.Text = "O" And Button5.Text = "O" And Button7.Text =
"O" Then
Button3.BackColor = Color.Black
Button5.BackColor = Color.Black
Button7.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerO.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button1.Text = "O" And Button5.Text = "O" And Button9.Text =
"O" Then
Button1.BackColor = Color.Black
Button5.BackColor = Color.Black
Button9.BackColor = Color.Black
MessageBox.Show("Winner is Player O", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerX.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
If Button3.Text = "O" And Button5.Text = "O" And Button7.Text =
"O" Then
Button3.BackColor = Color.Black
Button5.BackColor = Color.Black
Button7.BackColor = Color.Black
MessageBox.Show("Winner is Player X", "Tic Tac Toe",
MessageBoxButtons.OK, MessageBoxIcon.Information)
addOneToScore = Convert.ToInt64(LabelPlayerO.Text)
LabelPlayerO.Text = Convert.ToString(addOneToScore + 1)
buttonsEnabledFalse()
End If
End Sub
Private Sub Button_Click(sender As Object, e As EventArgs)
Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click,
Button5.Click, Button6.Click, Button7.Click, Button8.Click,
Button9.Click
Dim b As Button = sender
If checkForXorO = False Then
b.Text = "X"
checkForXorO = True
Else
b.Text = "O"
checkForXorO = False
End If
checkForWin()
b.Enabled = False
End Sub
Private Sub Button10_Click(sender As Object, e As EventArgs)
Handles Button10.Click
Button1.Enabled = True
Button2.Enabled = True
Button3.Enabled = True
Button4.Enabled = True
Button5.Enabled = True
Button6.Enabled = True
Button7.Enabled = True
Button8.Enabled = True
Button9.Enabled = True
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
Button1.BackColor = Color.White
Button2.BackColor = Color.White
Button3.BackColor = Color.White
Button4.BackColor = Color.White
Button5.BackColor = Color.White
Button6.BackColor = Color.White
Button7.BackColor = Color.White
Button8.BackColor = Color.White
Button9.BackColor = Color.White
End Sub
Private Sub ButtonNewGame_Click(sender As Object, e As
EventArgs) Handles Button11.Click
Button1.Enabled = True
Button2.Enabled = True
Button3.Enabled = True
Button4.Enabled = True
Button5.Enabled = True
Button6.Enabled = True
Button7.Enabled = True
Button8.Enabled = True
Button9.Enabled = True
Button1.Text = ""
Button2.Text = ""
Button3.Text = ""
Button4.Text = ""
Button5.Text = ""
Button6.Text = ""
Button7.Text = ""
Button8.Text = ""
Button9.Text = ""
Button1.BackColor = Color.White
Button2.BackColor = Color.White
Button3.BackColor = Color.White
Button4.BackColor = Color.White
Button5.BackColor = Color.White
Button6.BackColor = Color.White
Button7.BackColor = Color.White
Button8.BackColor = Color.White
Button9.BackColor = Color.White
LabelPlayerX.Text = "0"
LabelPlayerO.Text = "0"
End Sub
Private Sub ButtonExit_Click(sender As Object, e As EventArgs)
Handles Button12.Click
Dim checkForExit As DialogResult = MessageBox.Show("Confirm
if you want to exit", "Tic Tac Toe", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)
If checkForExit = DialogResult.Yes Then
Application.Exit()
End If
End Sub
End Class
Output
1.Template
2. When Player X Win
3. When Player O Win
4. When It’s Draw a match
5.When Exiting From Window
Conclusion
In conclusion, developing a Tic Tac Toe game
using VB.NET offers an opportunity to create a fun and
interactive project with a manageable scope. By
focusing on key elements such as user interface design,
game logic implementation, player interaction, and
optional features like AI opponents or visual
enhancements, you can create a polished and enjoyable
gaming experience for players.
Whether it's a simple two-player game or a
more advanced version with additional features,
building a Tic Tac Toe game in VB.NET provides a
great learning experience for both beginners and
experienced developers alike.
References
1. Resource Book
2. .https://www.mathsisfun.com/numbers/factorial.html
3. https://www.includehelp.com/embedded-system/
calculate-the factorial-of-a-number.aspx
4. https://www.calculatorsoup.com/calculators/
discretemathematics/factorials.php