0% found this document useful (0 votes)
124 views46 pages

Tic-Tac-Toe Game: A CBSE Class XII Computer Science Project (2024-2025)

This project, created by Berwin Jacob Kurian as part of the CBSE Class XII Computer Science curriculum for the academic year 2024-2025, demonstrates the development of a menu-driven Tic-Tac-Toe game. Designed using Python for the front end and MySQL for the back end, it offers an engaging gaming experience while managing player data and game history. Features include adding players, updating records, viewing scores, deleting player history, and resetting the game. The project integrates database management, GUI programming, and Python coding, serving as both a functional application and an educational resource.

Uploaded by

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

Tic-Tac-Toe Game: A CBSE Class XII Computer Science Project (2024-2025)

This project, created by Berwin Jacob Kurian as part of the CBSE Class XII Computer Science curriculum for the academic year 2024-2025, demonstrates the development of a menu-driven Tic-Tac-Toe game. Designed using Python for the front end and MySQL for the back end, it offers an engaging gaming experience while managing player data and game history. Features include adding players, updating records, viewing scores, deleting player history, and resetting the game. The project integrates database management, GUI programming, and Python coding, serving as both a functional application and an educational resource.

Uploaded by

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

Submitted for the partial fulfillment of AISSC

practical examination

DONE BY: Berwin Jacob Kurian


Certified to be the bonafide work done by Berwin Jacob
Kurian of class XII in the Computer Science during the
academic year 2024-2025.

Mrs. Jinshy Ajish


P.G.T in Computer Science
Integrated Indian School, Kuwait

Submitted for all Indian Senior Secondary School


certified practical examination held in the Computer
Science Laboratory of IIS.
Date:

External Examiner
Seal:
It is with great pleasure that I find myself penning
down these words to express my sincere thanks to all
those people who helped me along the way in
completing this project file.

The harmonious climate in our institution provided


proper academic setting. It was a privilege to have
been guided by Mrs. Jinshy Ajish.

Special thanks to all my friends who helped me


during the development of this project file.

Without the support extended by my parents this


project could not have attained its present form
and moreover I would like to thank the Lord for
this abundant grace upon me.
This is to certify that this project file is the original
work of Berwin Jacob Kurian of Integrated Indian
School under the guidance of Mrs. Jinshy Ajish during
the academic year 2024-2025 in the fulfillment of the
requirement of CBSE.

Done By: Berwin Jacob Kurian


Class: XII
INDEX

1. Theory of the project 6


2. Steps for developing the 7
program
3. Theory of Python 8-9
4. Features of Python 10-17
5. Theory of MySQL 18-19
6. Features of MySQL 20-27
7. Programming with 28-45
Snapshots and Source
Code
8. Bibliography 46
The primary purpose of the Tic-Tac-Toe game software
is designed to provide an enjoyable and interactive
gaming experience while managing player data and
game history effectively. It serves both as an
entertainment tool and an educational resource for
developers looking to improve their coding skills and
understanding of database management.This project
helps to do many Operations to the database table in
MySQL.
Library is simply a menu based project and has various
Options like:
ADD (): Used to add a new record to the item table.
DELETE (): Used to deleted a record from the item
table.
DISPLAY (): Used to display all the record in the
item table.
UPDATE (): Used to update details of the item table.

6.
• Create database in MySQL with a name
“tictac_game”.
and use the the database “tictac_game”.
• Insert some records into the table.
• Now open anaconda python and do the
codings
according to the requirements.
• Write the code for various button like add,
delete, update, insert, clear, search and exit.
• Open anaconda power shell prompt and install
pip.
• Now you can see that MySQL is connected to
Python.

7.
Python is an interpreted, high-level and general
purpose programming language.
Created by Guido van Rossum and first released in
1991, Python's design philosophy emphasizes
code readability with its notable use of significant
whitespace.
Its language constructs and object-oriented
approach aim to help programmers write clear,
logical code for small and large-scale projects.
It is used for
• web development (server-side),
• software development,
• mathematics,
• system scripting

8.
Python is dynamically typed and garbage-collected. It
supports multiple programming paradigms, including
structured (particularly, procedural), object oriented,
and functional programming. Python is often described
as "batteries included" language due to its
comprehensive standard library.
Python was created in the late 1980s as a successor to
the ABC language. Python 2.0, released in 2000,
introduced features like list comprehensions and a
garbage collection system with reference counting.
Python interpreters are available for many operating
systems.
A global community of programmers develops and
maintains CPython, a free and open-source reference
implementation. A non-profit organization, the Python
Software Foundation, manages and directs resources for
Python and Python development.

9.
As a programming language, the features of
Python :
brought to the table are many. Some of the most
significant features of Python are :

Easy to Code :
Python is a very developer-friendly language which
means that anyone and everyone can learn to code it in
a couple of hours or days. As compared to other
object-oriented programming languages like Java, C,
C++, and C#, Python is one of the easiest to learn.
Open Source and Free:
Python is an open-source programming language which
means that anyone can create and contribute to its
development. Python has an online forum where
thousands of coders gather daily to improve this
language further. Along with this Python is free to
download and use in any operating system, be it
Windows, Mac or Linux.

10.
Support for GUI :
GUI or Graphical User Interface is one of the key
aspects of any programming language because it
has the ability to add flair to code and make the
result more visual.
Python has support for a wide array of GUIs
which can easily be imported to the interpreter,
thus making this one of the most favorite
languages for developers.
High-Level Language
Python has been designed to be a high-level
programming language, which means that when
you code in Python you don’t need to be aware of
the coding structure, architecture as well as
memory management.
Integrated by Nature
Python is an integrated language by nature. This
means that the python interpreter executes codes
one line at a time. Unlike other object-oriented
programming languages, we don’t need to compile
Python code thus making the debugging process
much easier and efficient.

11.
Another advantage of this is, that upon execution
the Python code is immediately converted into an
intermediate form also known as byte-code which
makes it easier to execute and also saves runtime
in the long run.
Highly Portable
Suppose you are running Python on Windows and
you need to shift the same to either a Mac or a
Linux system, then you can easily achieve the
same in Python without having to worry about
changing the code. This is not possible in other
programming languages, thus making Python one
of the most portable languages available in the
industry.
Support for Other Languages
Being coded in C, Python by default supports the
execution of code written in other programming
languages such as Java, C, and C#, thus making it
one of the versatile in the industry.

12.
Advantages of Python

1) Easy to Read, Learn and Write


Python is a high-level programming language that has
English-like syntax. This makes it easier to read and
understand the code.
Python is really easy to pick up and learn, that is why
a lot of people recommend Python to beginners.
You need less lines of code to perform the same task
as compared to other major languages like C/C++ and
Java.
2) Improved Productivity
Python is a very productive language. Due to the
simplicity of Python, developers can focus on solving
the problem.
They don ’t need to spend too much time in
understanding the syntax or behaviour of the
programming language. You write less code and get
more things done.

13.
3) Interpreted Language
Python is an interpreted language which means that
Python directly executes the code line by line. In case
of any error, it stops further execution and reports back
the error which has occurred. Python shows only one
error even if the program has multiple errors. This
makes debugging easier.
4) Dynamically Typed
Python doesn’t know the type of variable until we run
the code. It automatically assigns the data type during
execution. The programmer doesn’t need to worry
about declaring variables and their data types.
5) Free and Open-Source
Python comes under the OSI approved open-source
license. This makes it free to use and distribute. You can
download the source code, modify it and even distribute
your version of Python. This is useful for organizations
that want to modify some specific behavior and use
their version for development.

14.
6) Vast Libraries Support
The standard library of Python is huge, you can find
almost all the functions needed for your task. So, you
don’t have to depend on external libraries. But even if
you do, a Python package manager (pip) makes things
easier to import other great packages from the Python
package index (PyPi). It consists of over 200,000
packages.
7) Portability
In many languages like C/C++, you need to change
your code to run the program on different platforms.
That is not the same with Python. You only write once
and run it anywhere. However, you should be careful
not to include any system-dependent features.

15.
Disadvantages of Python

1) Slow Speed
We discussed above that Python is an interpreted
language and dynamically-typed language. The line by
line execution of code often leads to slow execution.
The dynamic nature of Python is also responsible for
the slow speed of Python because it has to do the extra
work while executing code. So, Python is not used for
purposes where speed is an important aspect of the
project.
2) Not Memory Efficient
To provide simplicity to the developer, Python has to do
a little trade off. The Python programming language
uses a large amount of memory. This can be a
disadvantage while building applications when we
prefer memory optimization.
3) Weak in Mobile Computing
Python is generally used in server-side programming.
We don’t get to see Python on the client-side or mobile
applications because of the following reasons. Python
is not memory efficient and it has slow processing
power as compared to other languages.

16.
4) Database Access
Programming in Python is easy and stress-free. But
when we are interacting with the database, it lacks
behind. The Python’s database access layer is primitive
and under developed in comparison to the popular
technologies like JDBC and ODBC. Huge enterprises
need smooth interaction of complex legacy data and
Python is thus rarely used in enterprises.
5) Runtime Errors
As we know Python is a dynamically typed language so
the data type of a variable can change anytime. A
variable containing integer number may hold a string in
the future, which can lead to Runtime Errors. Therefore
Python programmers need to perform through testing of
the applications.

17.
MySQL is an open-source relational database management
system (RDBMS). Its name is a combination of "My", the
name of co-founder Michael Widenius's daughter, and "SQL",
the abbreviation for Structured Query Language.
MySQL is free and open-source software under the terms of
the GNU General Public License, and is also available under a
variety of proprietary licenses. MySQL was owned and
sponsored by the Swedish company MySQL AB, which was
bought by Sun Microsystems (now Oracle Corporation). In
2010, when Oracle acquired Sun, Widenius forked the open-
source MySQL project to create MariaDB.
MySQL is a component of the LAMP web application
software stack (and others), which is an acronym for Linux,
Apache, MySQL, Perl/PHP/Python.
MySQL is used by many database-driven web applications,
including Drupal, Joomla, phpBB, and WordPress. MySQL is
also used by many popular websites, including Facebook,
Flickr, MediaWiki, Twitter, and YouTube. MySQL is written
in C and C++. Its SQL parser is written in yacc, but it uses a
home-brewed lexical analyzer. MySQL works on many
system platforms, including AIX, BSDi, FreeBSD, HP-UX,
eComStation, i5/OS, IRIX, Linux, macOS, Microsoft
Windows, NetBSD, Novell NetWare, OpenBSD, OpenSolaris,
OS/2 Warp, QNX, Oracle Solaris, Symbian, SunOS, SCO
OpenServer, SCO UnixWare, Sanos and Tru64. A port of
MySQL to OpenVMS also exists.

18.
The MySQL server software itself and the client libraries use
dual-licensing distribution. They are offered under GPL
version 2, or a proprietary license.
Support can be obtained from the official manual. Free
support additionally is available in different IRC channels and
forums. Oracle offers paid support via its MySQL Enterprise
products. They differ in the scope of services and in price.
Additionally, a number of third party organisations exist to
provide support and services, including MariaDB and Percona.
MySQL has received positive reviews, and reviewers noticed
it "performs extremely well in the average case" and that the
"developer interfaces are there, and the documentation (not to
mention feedback in the real world via Web sites and the like)
is very, very good".
It has also been tested to be a "fast, stable and true multi-user,
multi-threaded SQL database server".

19.
o Relational Database Management System
(RDBMS): MySQL is a relational database
management system.
o Easy to use:
MySQL is easy to use. You have to get only the basic
knowledge of SQL. You can build and interact with
MySQL with only a few simple SQL statements.
o It is secure:
MySQL consist of a solid data security layer that
protects sensitive data from intruders. Passwords are
encrypted in MySQL. o Client/ Server Architecture:
MySQL follows a client /server architecture. There is a
database server (MySQL) and arbitrarily many clients
(application programs), which communicate with the
server; that is, they query data, save changes, etc.
o Free to download:
MySQL is free to use and you can download it from
MySQL official website. o It is scalable: MySQL can
handle almost any amount of data, up to as much as 50
million rows or more. The default file size limit is about
4 GB. However, you can increase this number to a
theoretical limit of 8 TB of data.

20.
o Compatible on many operating systems:
MySQL is compatible to run on many operating
systems, like Novell NetWare, Windows* Linux*, many
varieties of UNIX* (such as Sun* Solaris*, AIX, and
DEC* UNIX), OS/2, FreeBSD*, and others. MySQL
also provides a facility that the clients can run on the
same computer as the server or on another computer
(communication via a local network or the Internet).
o Allows roll-back: MySQL allows transactions to be
rolled back, commit and crash recovery.
o High Performance: MySQL is faster, more reliable
and cheaper because of its unique storage engine
architecture.
o High Flexibility:
MySQL supports a large number of embedded
applications which makes MySQL very flexible.
o High Productivity:
MySQL uses Triggers, Stored procedures and views
which allows the developer to give a higher productivity.

21.
Advantages of Using MySQL
It’s Easy To Use
MySQL is very easy to install, and thanks to a bevy of
third-party tools that can be added to the database,
setting up an implementation is a relatively simple task.
In addition, it’s also an easy database to work with. So
long as you understand the language, you shouldn’t run
into too many problems.
Support Is Readily Available
Whenever Necessary Although Oracle ’s history of
supporting its customers can be spotty at best, the
nature of MySQL – which got its start as an open-
source platform – means that there’s a large and thriving
community of developers and enthusiasts to which one
can turn for help. This is due in large part to the
popularity of the solution, the end result of which is no
shortage of experts.
It’ s Open-Source
(Sort Of) Oracle ’s purchase of Sun Microsystems (and
by association, MySQL) was met with some contention
from the development community. The general fear was
that Oracle would transform the tool into a closed,
proprietary ecosystem. Thankfully, though Oracle has
tightened its grip on MySQL somewhat, it can still be

22.
considered an open-source database option, as the code
is still available for free online.
It’ s Incredibly Inexpensive
Depending on what you plan to use it for, a MySQL
implementation could range in price from free to
$10,000 or more. Either way, it’s significantly less
expensive than most other database options on the
market (save for MySQL’s open-source competitors).
It’s An IndustryStandard ( And Still Extremely Popular)
Although MySQL’s popularity has waned somewhat in
recent years, it remains one of the most-used database
systems in the world. It’s compatible with virtually
every operating system, and is more or less an industry
standard. This is, of course, in spite of all the folks who
say it’s on the way out.

23.
Disadvantages Of Using MySQL
It’ s Got A few Stability Issues According to Digital
Ocean, MySQL tends to be somewhat less reliable than
its peers. These stability issues are related to the manner
in which it handles certain functions (such as references,
transactions, and auditing). While the database is
certainly still usable in light of these problems, they do
tend to make MySQL a poor choice for certain use
cases.
It Suffers From Relatively Poor Performance
Scaling
Although MySQL is equipped to handle a virtually
limitless volume of data, it has a troubling tendency to
come grinding to a halt if it’s forced to deal with too
many operations at a given time. This relatively poor
performance scaling means that anyone with high
concurrency levels should probably look into an
alternative. “In my experience,” writes software
engineer Koushik Ramachandra, “I have found that
MySQL works better when you have a low write/read
ratio, and offers low scalability as the read/write ratio
grows.”

24.
Development Is Not Community Driven – and Hence
Has Lagged
Since Oracle has taken the helm of MySQL’s
development, progress appears to have ground to a halt,
with only one major release in the past several years.
The company doesn ’t accept community-developed
patches, nor has it bothered to offer users any sort of
roadmap for MySQL development. There ’s really no
way for developers to discuss the database management
system with Oracle – and that’s a problem.
Its Functionality Tends To Be Heavily Dependent
On Addons
Although MySQL is relatively easy to set up, it tends to
have less out-of-the-box functionality than many other
database systems on the market. Certain features – such
as text search and ACID compliance – are dependant
not on the core engine but on applications and add-ons.
While it’s true that there exists a plethora of well-made
applications for MySQL, tracking them down can
sometimes be a pain, and might cause some developers
to simply choose an alternative which – while not as
easily installed – offers more immediate functionality.

25.
Developers May Find Some Of Its Limitations To Be
Frustrating
Not surprisingly, MySQL isn’t designed to do
everything (nor should it be). The database isn’t fully
SQL-compliant, and tends to be limited in areas
including data warehousing, fault tolerance, and
performance diagnostics (among others). Developers
may find this relative dearth of functionality frustrating,
particularly if they’re used to a more full-featured
alternative.

26.
The project includes –

Enter 1 - ADD PLAYER


Enter 2 - PLAY TIC-TAC TOE GAME
Enter 3 - UPDATE PLAYER
Enter 4 - SEARCH PLAYERS
Enter 5 - VIEW SCORES
Enter 6 - DELETE PLAYER HISTORY
Enter 7 -VIEW TOP SCORES
Enter 8 - VIEW GAME RULES
Enter 9 - RESET GAME
Enter 10- EXIT GAME

27.
28.
Connecting MySQL with Python.

Connecting through python

29.
ADDING PLAYER

30.
PLAY TIC-TAC TOE GAME

31.
UPDATE PLAYER

32.
SEARCH PLAYERS

VIEW SCORES

33.
DELETE PLAYER HISTORY

34.
VIEW TOP SCORE

VIEW GAME RULES

RESET GAME

35.
MENU DISPLAY AND EXIT

36.
OUTPUT
ADD PLAYER

PLAY GAME

37.
SCORE

UPDATE PLAYER

39.
SEARCH PLAYERS

VIEW SCORE

40.
DELETE PLAYER HISTORY

VIEW TOP SCORE

41.
VIEW GAME RULES

RESET GAME

42.
EXIT

43.
MYSQL DATABASE AND TABLES USED IN
THIS PROJECT

44.
TABLE STRUCTURE 1

BACKEND DATA GENERATED THROUGH


SOFTWARE

45.
1. python.org
2. Code Academy
3.tutorialsPoint.com
4. PythonChallenge.com
5. Google’s Python Class
6. LearnPython.org
7. www.wikipedia.orpythontheory.about.comw
ww.wikipedia.ormysql.sect.com
8. https://chatgpt.com/c/670108d5-9f78-800f-
b595-c5fccf515507

46.

You might also like