Final Updated Report Format
Final Updated Report Format
A Project Report On
SECOND YEAR
(Artificial Intelligence & Data Science)
SUBMITTED BY
Swanand Wakadmane
Vishal Gawade
Yash Jagtap
CERTIFICATE
Submitted by
Is a bonafide work carried out under the supervision of "Ms.Pachhade R.C.” and it
is submitted towards the partial fulfillment of the requirement of Savitribai Phule
Pune University, Pune for the award of the degree of Second year of Engineering
(Artificial Intelligence & Data Science).
ACKNOWLEDGEMENT
ABSTRACT
1. INTRODUCTION. ......................................................................... 01
2. FUNCTIONS TO BE USED ........................................................... 02
3. HARDWARE & SOFTWARE REQUIREMENTS ...................... 03
4. APPLICATIONS ............................................................................ 04
5. ADVANTAGES & DISADVANTGES ......................................... 05
6. PROGRAMMING MODULE ........................................................ 06
7. SOURCE CODE .............................................................................. 07
8. OUTPUT........................................................................................... 08
9. FUTURE APPLICATION .............................................................. 09
10. CONCLUSION ................................................................................ 10
11. REFERENCES ................................................................................ 11
Chapter : 1
INTRODUCTION
Problem Statement :
Design and implement a graphical Tic-Tac-Toe game using C++
that allows two players to play the game in real-time on a 3x3
grid.
The program should use the graphics.h library to render the grid
and other visual elements, providing an
engaging graphical interface for the players. The game should be
simple, intuitive, and responsive to user input.
Hardware Requirement :
Any Intel Pentium or later processor.
At least 4 MB of RAM.
A graphics card that supports DOS graphics modes.
Software Requirement:
Turbo C++ (or Turbo C): This is the most commonly used IDE
and compiler for C and C++ programs using graphics.h.
Chapter :8
6
APPLICATION
ADVANTAGES:
Educational Value-
• Simple Game Logic: The game is easy to understand and
provides beginners a great opportunity to learn basic game
development principles such as grid-based logic, turn-based
systems, and handling user input.
• Introduction to Graphics Programming: Using the
Non-Portable:
• DOS-Specific Environment: Since the code relies on Turbo
#define d 35 // d=distance
#define s 30 // s=size
#define f 200 // f=display coordinate factor
#define mx getmaxx()
#define my getmaxy()
char grid[3][3];
int main() {
int gd, gm, sx = 0, sy = 0, i, j, k, count = 2, player;
char str[25], ch;
detectgraph(&gd, &gm);
initgraph(&gd, &gm, "C:\\TC\\BGI");
while (1) {
cleardevice();
// Print TIC-TAC-TOE on screen
setcolor(BLUE);
outtextxy(200, 150, "TIC-TAC-TOE");
// Print current Player number
player = count % 2;
sprintf(str, "Player : %d (%c)", player + 1, player ? 'O' : 'X');
setcolor(WHITE);
outtextxy(350, 250, str);
display(sx, sy);
ch = getkey(); // Capture arrow key input
switch (ch) {
case 72: // Up arrow
if (sy != 0)
sy--;
break;
case 80: // Down arrow
if (sy != 2)
sy++;
break;
case 75: // Left arrow
if (sx != 0)
sx--;
break;
case 77: // Right arrow
if (sx != 2)
sx++;
break;
case ' ': // Space key
if (grid[sy][sx] == ' ') { // Mark the cell only if it is empty
if (player == 0)
grid[sy][sx] = 'X';
else
grid[sy][sx] = 'O';
Chapter : 8
count++;
}
break;
case 'e':
case 'E': //'e' or 'E' key
cleardevice();
closegraph();
return 0;
default:
break;
}
if (checkWin(sx, sy, player) == 1 || checkDraw(sx, sy) == 1)
break;
}
return 0;
}
int getkey() {
int ch;
ch = getch();
if (ch == 0) {
ch = getch();
return ch;
}
return ch;
}
OUTPUT
Chapter:9
FUTURE APPLICATION
1. AI Opponent:
• Benefits: Improves user experience with a modern look and feel, including
animations and better interactions.
4. Mobile Application:
• Description: Adapt the code to create a mobile version for Android or iOS
using frameworks like Cocos2d-x or Unity.
CONCLUSION
REFERENCES
• https://www.geeksforgeeks.org/implementation-of-tic-tac-toe-game/
• https://www.scribd.com/document/385171876/Tic-Tac-Toe-
Documentation-in-python-3
• https://www.researchgate.net/publication/365802213_Implementation
_of_a_Tic-Tac-
Toe_game_Using_Python_Environment_for_gaming_application
• https://graphicswithc.wordpress.com/
• https://github.com/Ahsan483/