Final Project Report Print
Final Project Report Print
on
“2048 game with python”
During
II year II semester Summer
Submitted to
The Department of Data Science
In partial fulfillment of the academic requirements of
Jawaharlal Nehru Technological University
For
The award of the degree of
Bachelor of Technology
in
DATA SCIENCE
By
Name: G.AKSHITHA Roll no: 21311A6721
This is to certify that this Summer Industry Internship – I Report on “2048 game with
python”, submitted by G. Akshitha (21311A6721) in the year 2024 in partial fulfillment of
the academic requirements of Jawaharlal Nehru Technological University for the award of
the degree of Bachelor of Technology in Computer Science and Engineering, is a bonafide
work in industry internship that has been carried out during II II Semester Summer, will
be evaluated in III I Semester , under our guidance. This report has not been submitted to
any other institute or university for the award of any degree.
External Examiner
Date:-
DECLARATION
AND TECHNOLOGY for partial fulfillment for the award of degree of Bachelor of
technology in DATA SCIENCE It is declared to the best of our knowledge that the work
reported does not form part of any dissertation submitted to any other University or Institute
for award of any degree.
G.Akshitha,
21311A6721
ACKNOWLEDGEMENT
I would like to express my gratitude to all the people behind the screen who helped me to
transform an idea into a real application.
I would like to thank my Summer Industry Internship Coordinator, Dr. K. Premnadh for
his/her technical guidance, constant encouragement and support in carrying out my project at
college.
I profoundly thank Dr. Jaffer Sadiq, Head of the Department of Data Science who has been
an excellent guide and also a great source of inspiration to my work.
I would like to express my heart-felt gratitude to my parents without whom I would not have
been privileged to achieve and fulfill my dreams. I am grateful to our principal, Dr. T. Ch.
Siva Reddy, who most ably run the institution and has had the major hand in enabling me to
do my project.
The satisfaction and euphoria that accompany the successful completion of the task would be
great but incomplete without the mention of the people who made it possible with their
constant guidance and encouragement crowns all the efforts with success. In this context, I
would like thank all the other staff members, both teaching and non-teaching, who have
extended their timely help and eased my task.
G.AKSHITHA
21311A6721
INDEX
page no.
Abstract 1
1.Introduction 2
2.Project Objectives 3
3.System requirements 4
4.System Architecture 5
5.Implementation 6-13
6.Result 14-15
7.Future enhancements 17
8.Conclusion 18
ABSTRACT
1
1.Introduction
2.Project objectives
Game Implementation: Develop a functional 2048 game
using Python, ensuring that the game mechanics align with the
original rules.
3
3.System Requirements
Programming Language: Python is the primary language for
implementing the game logic.
Tkinter
Python offers multiple options for developing GUI (Graphical User
Interface). Out of all the GUI methods, tkinter is the most commonly
used method. It is a standard Python interface to the Tk GUI toolkit
shipped with Python. Python tkinter is the fastest and easiest way to
create GUI applications. Creating a GUI using tkinter is an easy task.
Random module
Python IDLE:
Python IDLE (Integrated Development and Learning Environment) is
a basic, lightweight Integrated Development Environment that comes
bundled with the Python programming language.
4
4.System architecture
5
5.Implementation
IMPORTING MODULES
Tkinter :
• Purpose: Tkinter is the standard GUI toolkit that comes
with Python. While Pygame is often used for game
graphics, Tkinter might be considered for creating a
simple graphical user interface (GUI) for settings, score
display, or game information.
• Usage: Creating a minimalistic GUI for displaying game
information or providing additional settings.
Random:
• Purpose: The built-in random module in Python
provides functions for generating pseudo-random
numbers. It's useful for placing initial tiles randomly on
the game grid.
• Usage: Randomly placing new tiles with values of 2 or 4
at empty positions during
the game initialization.
7
b.full()
This function will check whether all the grid in the game is
full or not. It will return either True or False.
c.show_board()
This function will show the game board. Each number in the
game window will have a separate color. The numbers in the
game board are 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 and
2048.
8
d. show_number0()
This function will have to show the color of the grid when
there is no number on it.
e.show_number()
This function will show the color of the grid and number as
respect to the different numbers.
f. moves()
This function will accept the different events performed by
the user and perform the movement of blocks of grid as per
the event. The events given by the user are ‘UP’, ‘DOWN’,
‘LEFT’, and ‘RIGHT’.
9
10
g. new_game()
This function will create a new game for the user. It will
display a fresh game with the last highest score of the user.
h. game_over()
This function will check for game over, it will return True if
the game is over and display a new empty grid window
displaying “GAME OVER”.
11
i.game_won()
This function will check for a game won and condition for
game won is the user has to make a grid of value 2048, then it
will return True and display a new empty grid window
displaying “GAMEWON!”.
12
Creating the main function
In the main function, the main window of tkinter is made and
the creation of objects for the main class is done. In this
function, we will pass the user moves, title of our project, size
of game window.
13
6.Result
14
15
7.Future Enhancements
Multiplayer Mode:
Introduce a multiplayer mode where two players can compete
against each other in real-time. This could be done locally or
over a network.
Difficulty Levels:
Implement difficulty levels with varying complexities. For
example, easy mode can have larger tile values, while hard
mode can have smaller tile values, making it more
challenging.
Tutorial Mode:
Include a tutorial mode that guides new players through the
rules and strategies of the game.
16
8.Conclusion:
17
In conclusion, the "2048 game with Python" project has
provided valuable insights into game development,
algorithmic thinking, and the application of programming
concepts. It has been an opportunity to apply theoretical
knowledge to a real-world project, reinforcing the importance
of hands-on experience in the learning process.
18