You are on page 1of 36

INTERNSHIP REPORT

A Report Submitted to
Jawaharlal Nehru Technological University Kakinada, Kakinada
in partial fulfillment for the award of the degree of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING

Submitted by
THOTA HANISH MANIKANTA
(20KN1A05G9)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


NRI INSTITUTE OF TECHNOLOGY
Autonomous
(Approved by AICTE, Permanently Affiliated to JNTUK, Kakinada)
Accredited by NBA (CSE, ECE & EEE), Accredited by NAAC with ‘A’ Grade
ISO 9001: 2015 CertifiedInstitution
Pothavarappadu (V), (Via) Nunna, Agiripalli (M), Krishna Dist., PIN: 521212, A.P, India.

2020-2021
NRI INSTITUTE OF TECHNOLOGY
(An Autonomous Institution, Approved by AICTE, Permanently Affiliated to JNTUK, Kakinada)
Accredited by NBA (CSE, ECE & EEE), Accredited by NAAC with ‘A’ Grade
ISO 9001: 2015 Certified Institution
Pothavarappadu (V), (Via) Nunna, Agiripalli (M), Krishna Dist., PIN: 521212, A.P, India.

CERTIFICATE

This is to certify that the “Internship report” submitted by THOTA HANISH MANIKANTA (Regd.
No.: 20KN1A05G9) is work done by his/her and submitted during YEARS academic year, in partial
fulfillment of the requirements for the award of the degree of BACHELOR OF TECHNOLOGY in
COMPUTER SCIENCE AND ENGINEERING, at BLACKBUCK ENGINEERS PVT LTD,
Road No:36, Jubilee Hills, Hyderabad, Telangana.

INTERNSHIP COORDINATOR Head of the Department

(R KATHYAYANI) (Dr. D. SUNEETHA)

EXTERNAL EXAMINER
Internship Experience Letter

Certificate ID: BBNR0177 Issued Date: 01st November 2022

To Whom It May Concern:

This is to certify that THOTA HANISH MANIKANTA has successfully


completed internship at Blackbuck Engineers Pvt Ltd, and He worked
with us from 13th June 2022 to 05th September 2022.

He has worked on a project titled PIng Pong Bot by learning and


incorporating Artificial Intelligence & Machine Learning concepts under
the supervision of our project mentor.

We found that He is sincere, hardworking, technically sound and result


oriented. He worked well as part of a team during the tenure.

We wish all the best for future endeavours.

Best regards,

Kathyayani Rudravelli Mounika Bezawada


Project Head HR Manager
Blackbuck Engineers Pvt Ltd Blackbuck Engineers Pvt Ltd
ACKNOWLEDGEMENT

I take this opportunity to thank all who have rendered their full support to my work.
The pleasure, the achievement, the glory, the satisfaction, the reward, the appreciation and the
construction of my project cannot be expressed with a few words for their valuable suggestions.

I am expressing my heartfelt thanks to Head of the Department, Dr. D. SUNEETHA


garu for her continuous guidance for completion of my Project work.

I am extending our sincere thanks to Dean of the Department, Dr. K. V. SAMBASIVA


RAO for his continuous guidance and support to complete my project successfully.

I am thankful to the Principal, Dr. C. NAGA BHASKAR garu for his encouragement to
complete the Project work.

I am extending my sincere and honest thanks to the Chairman, Dr. R. VENKATA RAO
garu & Secretary, Sri K. Sridhar garu for their continuous support in completing the Project
work.

Finally, I thank the Administrative Officer, Staff Members, Faculty of Department of


CSE, NRI Institute of Technology and my friends, directly or indirectly helped us in the
completion of this project.

THOTA HANISH MANIKANTA

20KN1A05G9
ABSTRACT

INTRODUCTION:
Being one of the earliest computer games, the Pong game is well-known for its
simplicity, which makes it suitable for becoming one of the very first problems in
Artificial Intelligence and Machine Learning. The goal is to create a self-playing
agent that can compete against humans. In the past there have been introduced
various Machine Learning approaches to solve this problem.
In this project, we are going to create a Pong Game using Python Turtle. Pong is a
well-known computer game that is similar to table tennis. The two players in this
game control the two paddles on either side of the game window. To hit the moving
ball, they move the paddles up and down. A player’s score rises when he or she hits
the ball or when the opponent misses the hit.
Libraries and Technologies used:
• turtle

• python
Project Flow:

Finally task of building the game of Pong from scratch is done. We successfully
developed the Pong Game using Python Turtle We learned how to make forms for
blocks and balls, as well as how to modify the pace and refresh the screen. Using just
those 2 parameters, it learns what moves it needs to make to become better.
Methodologies:

We follow a structured methodology for our projects which starts from designing
the solution to the implementation phase. Well planned Project reduces the time to
deliver the project and any additional ad-hoc costs to our clients, hence we dedicate
majority of our time understanding our clients business and gather requirements.
This ground up approach helps us deliver not only the solution to our clients but also
add value to your investments.

Key parts of the report:


Under each division we further provide specific industry solutions on focused
domains with cutting edge technologies.

Benefits of the Company/Institution through our report:

Under each division we further provide specific industry solution on focused


domains with cutting edge technologies. We emphasize on building relationships
with our clients by delivering projects on time and within budget.
INDEX

S.no CONTENTS Page no


1. Introduction ..................................................................................................... 1-3

a. Modules ............................................................................................................3

2. Analysis…………………………………………………………………………….4-6

3. Software requirement specifications………………………………………………7-8

4. Technology………………………………………………………………………….9-12

a. PYTHON……………………………………………………………………….10

b. Turtle…………………………………………………………………………11-12

5. Architecture……………………………………………………………………….13-14

6. Coding……………………………………………………………………………….15-19

7. Screenshots………………………………………………………………………….20-21

8. Conclusion……………………………………………………………………….…22-23

9. Bibliography………………………………………………………………………..24-25
Learning Objectives/Internship Objectives

 Internships are generally thought of to be reserved for college students looking


to gain experience in a particular field. However, a wide array of people can
benefit from Training Internships in order to receive real world experience and
develop their skills.

 An objective for this position should emphasize the skills you already possess
in the area and your interest in learning more

 Internships are utilized in a number of different career fields, including


architecture, engineering, healthcare, economics, advertising and many more.

 Some internship is used to allow individuals to perform scientific research


while others are specifically designed to allow people to gain first-hand
experience working.

 Utilizing internships is a great way to build your resume and develop skills
that can be emphasized in your resume for future jobs. When you are applying
for a Training Internship, make sure to highlight any special skills or talents
that can make you stand apart from the rest of the applicants so that you have
an improved chance of landing the position.
WEEKLY OVERVIEW OF INTERNSHIP ACTIVITIES

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


13.06.2022 Monday Introduce the Topic & the Problem Statement
1st WEEK

14.06.2022 Tuesday Introduce the Topic & the Problem Statement


15.06.2022 Wednesday Introduce the Topic & the Problem Statement
16.06.2022 Thursday Introduce the Topic & the Problem Statement
17.06.2022 Friday Introduce the Topic & the Problem Statement

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


20.06.2022 Monday Abstract Building
2nd WEEK

21.06.2022 Tuesday Abstract Building


22.06.2022 Wednesday Abstract Building
23.06.2022 Thursday Abstract Building
24.06.2022 Friday Abstract Submission

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


27.06.2022 Monday Abstract Submission
28.06.2022 Tuesday Abstract Submission
29.06.2022 Wednesday Explain your Approach to Solving Problem
3rd WEEK

30.06.2022 Thursday Explain your Approach to Solving Problem

01.07.2022 Friday Explain your Approach to Solving Problem

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


WEEK

04.07.2022 Monday Explain your Approach to Solving Problem


05.07.2022 Tuesday Explain Structure of Project
4th

06.07.2022 Wednesday Explain Structure of Project


07.07.2022 Thursday Explain Structure of Project
08.07.2022 Friday Explain Structure of Project

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


5th WEEK

11.07.2022 Monday Data Preprocessing


12.07.2022 Tuesday Data Preprocessing
13.07.2022 Wednesday Data Preprocessing
14.07.2022 Thursday Data Preprocessing
15.07.2022 Friday Data Preprocessing

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


6th WEEK

18.07.2022 Monday Perform Analysis


19.07.2022 Tuesday Perform Analysis
20.07.2022 Wednesday Perform Analysis
21.07.2022 Thursday Perform Analysis
22.07.2022 Friday Perform Analysis

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


7th WEEK

25.07.2022 Monday PPT Preparation


26.07.2022 Tuesday PPT Preparation
27.07.2022 Wednesday PPT Preparation
28.07.2022 Thursday PPT Preparation
29.07.2022 Friday PPT Preparation

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


8th WEEK

01.08.2022 Monday PPT Submission


02.08.2022 Tuesday PPT Submission
03.08.2022 Wednesday Mid Review
04.08.2022 Thursday Mid Review
05.08.2022 Friday Mid Review

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


9th WEEK

08.08.2022 Monday Mid Review


10.08.2022 Tuesday Mid Review
11.08.2022 Wednesday Building & Applying Algorithm
12.08.2022 Thursday Building & Applying Algorithm

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


10th WEEK

16.08.2022 Tuesday Building & Applying Algorithm


17.08.2022 Wednesday Building & Applying Algorithm
19.08.2022 Friday Building & Applying Algorithm

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


11th WEEK

22.08.2022 Monday Concluding Project


23.08.2022 Tuesday Concluding Project
24.08.2022 Wednesday Concluding Project
25.08.2022 Thursday Concluding Project
26.08.2022 Friday Concluding Project

DATE DAY NAME OF THE TOPIC/MODULE COMPLETED


12th WEEK

29.08.2022 Monday Final Review


30.08.2022 Tuesday Final Review
01.09.2022 Wednesday Final Review
02.09.2022 Thursday Final Review
05.09.2022 Friday Final Review
CHAPTER -1

INTRODUCTION

1
INTRODUCTION

Ping pong:
Pong is one of the famous computer games that resembles table tennis. In this game,
the two players control the two paddles on either side of the game window.
They move the paddles up or down to hit the moving ball. The score of a player
increases either when he/she hits the ball or when the opponent misses the hit.
The rules of this game are simple:
 There are two players.
 Both have control over the paddle of their side.
 They can move the paddle on vertical sides from up to down and down to up.
 Players can strike back and forth on the ball by using the paddle.

Python Pong Game – Project Details


We will be using the turtle module to build this game in Python. In this game, we will
be using the up, down, left, and right keys to move the left and the right paddles. Also,
the speed of the ball increases, along with the score, as a player hits the ball to
predefined speed level.
Once a player misses the hit, the ball again starts from center towards the other player
along with the increase in the score of the opponent.

2
1.1Module Description:

The first step is to import the turtle module. We will use this module to build the
whole game.

Turtle: The turtle is a built-in module in Python which is used for graphical
illustrations. The users can use it as a pen and panel to illustrate the graphics.

The following are the steps used for illustrating Ping Pong game:

o Step 1: The user has to create two Paddles for the "Left Side" and "Right Side"
of the screen.
o Step 2: The user then has to create the ball.
o Step 3: Then, create an event for moving the paddles vertically by pressing the
particular keys, that is, for "Left Paddle": "R" for "Up" and "C" for "Down", for
"Right Paddle": "Up key ()" for "Up" and "Down key ()" for "Down".
o Step 4: At last, create the function for updating the score after each player misses
the strike on the ball.

3
CHAPTER -2

SYSTEM ANALYSIS

4
SYSTEM ANALYSIS

REQUIREMENT ANALYSIS:

Existing System:

PING PONG Table tennis, also known as ping-pong is a sport in which two
players hit a lightweight ball, also known as the ping-pong ball, back and forth
across a table using small rackets. The game takes place on a hard table divided by a
net . The game of Pong is an excellent example of a simple RL task. In the ATARI
2600 version we’ll use you play as one of the paddles (the other is controlled by a
decent AI) and you have to bounce the ball past the other player. On the low level
the game works as follows: we receive an image frame (a 210x160x3 byte array
(integers from 0 to 255 giving pixel values)) and we get to decide if we want to
move the paddle UP or DOWN (i.e. a binary choice). In the code, after illustrating
the outlook of the screen with paddles and ball, we will first initialize the score of
both the players, that is, Zero. Then, we will display the score on the screen, which
will increase with the opposite player missing the strike. We will then implement
the functions for moving the paddle vertically. We will bind the keys for each
function, that is, for "Left Paddle": "R" for "Up" and "C" for "Down", for "Right
Paddle": "Up key" for "Up" and "Down key" for "Down". Then, we will initiate
how the ball and striking of the paddle will work, as if the ball hit the paddle, it will
go for the opposite player, but if the paddle missed the ball, then the ball will hit the
border, and the opposite player will get the score. If the code is correct and no error
is found, the screen of Ping Pong Game will pop up after running the code, and the
players can play. The ball will first go for the right player.

5
Proposed System:

we can also use HTML and JavaScript to implement Ping Pong Bot
game. Here we have a canvas to render the game and two paragraph tags to display
the scores. The block with class small-device is to disable the game and display the
message on small screens because there won’t be keyboard controls.

The CSS file style.css and JavaScript file script.js are linked to this HTML file.

Now we have to add some styles to our page to make it look nice. The look and feel
of a page are also an important part. Game logic is implemented by using JavaScript

6
CHAPTER -3

SOFTWARE REQUIREMENTS AND


SPECIFICATIONS

7
SOFTWARE REQUIREMENTS SPECIFICATIONS

System configurations
The software requirement specification can produce at the culmination of the
analysis task. The function and performance allocated to software as part of system
engineering are refined by established a complete information description, a detailed
functional description, a representation of system behavior, and indication of
performance and design constrain, appropriate validate criteria, and other
information pertinent to requirements.

Software Requirements:

• Operating system : Windows 7 Ultimate.


• Coding Language : Python
• Library : Turtle
• Front-End : Visual Studio 2012 Professional.

Hardware Requirement:

• Speed : Above 1GHz


• RAM capacity :2 GB
• Graphics : OpenGL 2.1 or OpenGL ES 2
• Keyboard : Standard
• Mouse : Standard
• Monitor : SVGA Color

8
CHAPTER-4

TECHNOLOGY

9
TECHNOLOGY

PYTHON:

Python is an interpreted, object-oriented, high-level programming language with


dynamic semantics. Its high-level built in data structures, combined with dynamic
typing and dynamic binding, make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue language to connect existing
components together. Python's simple, easy to learn syntax emphasizes readability
and therefore reduces the cost of program maintenance. Python supports modules
and packages, which encourages program modularity and code reuse. The Python
interpreter and the extensive standard library are available in source or binary form
without charge for all major platforms, and can be freely distributed.
Often, programmers fall in love with Python because of the increased productivity
it provides. Since there is no compilation step, the edit-test-debug cycle is
incredibly fast. Debugging Python programs is easy: a bug or bad input will never
cause a segmentation fault. Instead, when the interpreter discovers an error, it
raises an exception. When the program doesn't catch the exception, the interpreter
prints a stack trace. A source level debugger allows inspection of local and global
variables, evaluation of arbitrary expressions, setting breakpoints, stepping through
the code a line at a time, and so on. The debugger is written in Python itself,
testifying to Python's introspective power. On the other hand, often the quickest
way to debug a program is to add a few print statements to the source: the fast edit-
test-debug cycle makes this simple approach very effective.

10
TURTLE:

The turtle is a built-in module in Python which is used for graphical illustrations.
The users can use it as a pen and panel to illustrate the graphics.

Method Parameter Description

Turtle() None Creates and returns a new turtle object

forward() amount Moves the turtle forward by the specified amount

Moves the turtle backward by the specified


backward() amount amount

right() angle Turns the turtle clockwise

left() angle Turns the turtle counterclockwise

penup() None Picks up the turtle’s Pen

pendown() None Puts down the turtle’s Pen

up() None Picks up the turtle’s Pen

down() None Puts down the turtle’s Pen

Color
color() name Changes the color of the turtle’s pen

Color Changes the color of the turtle will use to fill a


fillcolor() name polygon

heading() None Returns the current heading

position() None Returns the current position

11
Method Parameter Description

goto() x, y Move the turtle to position x,y

begin_fill() None Remember the starting point for a filled polygon

Close the polygon and fill with the current fill


end_fill() None color

dot() None Leave the dot at the current position

Leaves an impression of a turtle shape at the


stamp() None current location

shape() shapename Should be ‘arrow’, ‘classic’, ‘turtle’ or ‘circle’

12
CHAPTER-5

ARCHITECTURE

13
Architecture Of Ping pong bot using Turtle
14
CHAPTER-6

CODING

15
CODING

import os
import turtle

# First, we will create screen


screen_1 = turtle.Screen()
screen_1.title("Ping-Pong Game")
screen_1.bgcolor("Yellow")
screen_1.setup(width = 1050, height = 650)

# Left paddle
left_paddle = turtle.Turtle()
left_paddle.speed(0)
left_paddle.shape("square")
left_paddle.color("Red")
left_paddle.shapesize(stretch_wid = 6, stretch_len = 2)
left_paddle.penup()
left_paddle.goto(-400, 0)

# Right paddle
right_paddle = turtle.Turtle()
right_paddle.speed(0)
right_paddle.shape("square")
right_paddle.color("Blue")
right_paddle.shapesize(stretch_wid = 6, stretch_len = 2)
right_paddle.penup()
right_paddle.goto(400, 0)

# Ball of circle shape


hit_ball = turtle.Turtle()
hit_ball.speed(45)
hit_ball.shape("circle")
hit_ball.color("Black")
hit_ball.penup()
hit_ball.goto(0, 0)

16
hit_ball.dx = 5
hit_ball.dy = -5

# Now, we will initialize the score


left_player = 0
right_player = 0

# Displaying of the score


sketch_1 = turtle.Turtle()
sketch_1.speed(0)
sketch_1.color("blue")
sketch_1.penup()
sketch_1.hideturtle()
sketch_1.goto(0, 260)
sketch_1.write("Left Player : 0 Right Player: 0",
align = "center", font = ("Courier", 24, "normal"))

# Implementing the functions for moving paddle vertically


def paddle_L_up():
y = left_paddle.ycor()
y += 20
left_paddle.sety(y)

def paddle_L_down():
y = left_paddle.ycor()
y -= 20
left_paddle.sety(y)

def paddle_R_up():
y = right_paddle.ycor()
y += 20
right_paddle.sety(y)

def paddle_R_down():
y = right_paddle.ycor()
y -= 20
right_paddle.sety(y)
17
# Then, binding the keys for moving the paddles up and down.
screen_1.listen()
screen_1.onkeypress(paddle_L_up, "Left")
screen_1.onkeypress(paddle_L_down, "Right")
screen_1.onkeypress(paddle_R_up, "Up")
screen_1.onkeypress(paddle_R_down, "Down")

while True:
screen_1.update()

hit_ball.setx(hit_ball.xcor() + hit_ball.dx)
hit_ball.sety(hit_ball.ycor() + hit_ball.dy)

# Check all the borders


if hit_ball.ycor() > 280:
hit_ball.sety(280)
hit_ball.dy *= -1

if hit_ball.ycor() < -280:


hit_ball.sety(-280)
hit_ball.dy *= -1

if hit_ball.xcor() > 500:


hit_ball.goto(0, 0)
hit_ball.dy *= -1
left_player += 1
sketch_1.clear()
sketch_1.write("Left_player : {} Right_player: {}".format(
left_player, right_player), align = "center",
font = ("Courier", 24, "normal"))

if hit_ball.xcor() < -500:


hit_ball.goto(0, 0)
hit_ball.dy *= -1
right_player += 1
sketch_1.clear()
sketch_1.write("Left_player : {} Right_player: {}".format(
left_player, right_player), align = "center",
font = ("Courier", 24, "normal"))

18
# Collision of ball and paddles
if (hit_ball.xcor() > 360 and
hit_ball.xcor() < 370) and (hit_ball.ycor() < right_paddle.ycor() + 40 and
hit_ball.ycor() > right_paddle.ycor() - 40):
hit_ball.setx(360)
hit_ball.dx *= -1

if (hit_ball.xcor() < -360 and


hit_ball.xcor() > -370) and (hit_ball.ycor() < left_paddle.ycor() + 40 and
hit_ball.ycor() > left_paddle.ycor() - 40):
hit_ball.setx(-360)
hit_ball.dx *= -1

19
CHAPTER-7

SCREENSHOTS

20
SCREENSHOTS

21
CHAPTER-8

CONCLUSION

22
CONCLUSION

With this Python project, we have successfully built the Pong game. For
this, we used the turtle module. We learned how to create shapes for blocks, balls,
change the speed and update the screen.
we have created a simple illustration of a ping pong game on the screen by using the
built-in library of Python, that is, Turtle. The user can create different moving
illustrations by using the turtle library and its different functions.
By the end of this project, we have created The Classic Ping Pong game
using Python and Turtle graphics. we also be able to identify and use most of
Turtle’s modules and functions that helps you develop and build your own game.
Moreover, we are able to edit and manipulate the objects created by Turtle however
we like.

23
CHAPTER-9

BIBLIOGRAPHY

24
BIBLIOGRAPHY

[1]Turtle Basics :https://docs.python.org/3/library/turtle.html


[2]Python Turtle motion: https://docs.python.org/3/library/turtle.html#turtle-
motion
[3] LeCun, Y., Bottou, L., Bengio, Y., & Haffner, P. (1998). Gradient-based learning
applied to document recognition. Proceedings of the IEEE, 86(11), 2278-2324.

25

You might also like