0% found this document useful (0 votes)
100 views

Python Prog pbl1

This document is a project report on creating a dice rolling simulator. It was submitted by 6 students to fulfill their Bachelor of Technology degree requirements. The report introduces dice and their common characteristics. It then describes implementing the simulator in Python using the random and Tkinter libraries to randomly select a dice roll and display it. Screenshots show the interface allowing users to click a button to roll a dice virtually and see the result. The conclusion states the simulator was successfully created to introduce randomness for board games without physical dice.

Uploaded by

SAI PRANEETH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

Python Prog pbl1

This document is a project report on creating a dice rolling simulator. It was submitted by 6 students to fulfill their Bachelor of Technology degree requirements. The report introduces dice and their common characteristics. It then describes implementing the simulator in Python using the random and Tkinter libraries to randomly select a dice roll and display it. Screenshots show the interface allowing users to click a button to roll a dice virtually and see the result. The conclusion states the simulator was successfully created to introduce randomness for board games without physical dice.

Uploaded by

SAI PRANEETH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

CSM Department CMREC 2023-2024

A PBL Project Report


On

Dice Rolling Simulator


Submitted to JNTU HYDERABAD
In Partial Fulfilment of the requirements for the Award of Degree of
BACHELOR OF TECHNOLOGY IN
COMPUTER SCIENCE AND ENGINEERING (AI&ML)

Submitted By

D. Sri Vaishnavi -(218R1A66E8)


T.D Vinayak Tejavath -(218R1A66I7)
N. Kowshik Anand -(218R1A66H4)
B. Sai Praneeth - (218R1A66D9)
K. Prasanna Kumari -(218R1A66G1)
J. Sai Balaji -(218R1A66F7)

Under the Esteemed guidance of


Mr. Rajesh Tiwari

Assistant Professor, Department of CSM

Department of Computer Science & Engineering (AI&ML)

CMR ENGINEERING COLLEGE


(Approved by AICTE, NEW DELHI, Affiliated to JNTU, Hyderabad)
Kandlakoya, Medchal Road, R.R. Dist. Hyderabad-501 401
2023-2024
CMR ENGINEERING COLLEGE
(Accredited by NBA, Approved by AICTE NEW DELHI, Affiliated to JNTU, Hyderabad)

Kandlakoya, Medchal Road, Hyderabad-501 401

Department of Computer Science & Engineering (AI&ML)

CERTIFICATE

This is to certify that the PBL entitled “Dice Rolling Simulator” is a bonafide work carried out by

D. Sri Vaishnavi -(218R1A66E8)


T.D Vinayak Tejavath -(218R1A66I7)
N. Kowshik Anand -(218R1A66H4)
B. Sai Praneeth - (218R1A66D9)
K. Prasanna Kumari -(218R1A66G1)
J. Sai Balaji -(218R1A66F7)

In partial fulfilment of the requirement for the award of the degree of BACHELOR OF
TECHNOLOGY IN COMPUTER SCIENCE AND ENGINEERING AI&ML from, CMR
Engineering College, affiliated to JNTU, Hyderabad, under our guidance and supervision. The
results presented in this seminar have been verified and are found to be satisfactory. The results
embodied in this seminar have not been submitted to any other university for the award of any other
degree or diploma

Internal Guide Head of the Department

Mr.Rajesh Tiwari Dr. Kumara Swamy

Assistant Professor Professor & H.O.D

Department of CSM CMREC, Department of CSM CMREC,

Hyderabad. Hyderabad
DECLARATION

This is to certify that the work reported in the present project entitled "Dice
Rolling Simulator" is a record of bonafide work done by me in the
Department of Computer Science and Engineering (AI & ML), CMR
Engineering College. The reports are based on the project work done entirely
by me and not copied from any other source. I submit my project for further
development by any interested students who share similar interests to
improve the project in the future.
The results embodied in this project report have not been submitted to any
other University or Institute for the award of any degree or diploma to the
best of our knowledge and belief.

D. Sri Vaishnavi -(218R1A66E8)


T.D Vinayak Tejavath -(218R1A66I7)
N. Kowshik Anand -(218R1A66H4)
B. Sai Praneeth - (218R1A66D9)
K. Prasanna Kumari -(218R1A66G1)
J. Sai Balaji -(218R1A66F7)
CONTENTS

TOPIC

1. INTRODUCTION

2. IMPLEMENTATION

3. SOURCE CODE

4. OUTPUT SCREENS

5. CONCLUSION
INTRODUCTION

 Dice are an ancient tool that has been used for various purposes
throughout history. They are small, typically cubical objects with
each face marked with a different number of dots, ranging from
one to six. The most common type of die used in games is the
six-sided die, often referred to as a six-sided die or a D6.

1. Faces and Numbers:-


A standard six-sided die has six faces, each representing a number
from one to six.
The numbers on opposite faces of the die always add up to seven (1
and 6, 2 and 5, 3 and 4).

2. Material and Construction:-


Dice are traditionally made from materials like plastic, wood, or
metal.
The pips (dots) on each face are typically indented or raised to make
them easily visible.

3. Randomness:
Dice are known for their ability to introduce an element of
randomness into games.
When thrown or rolled, the outcome is unpredictable and depends on
various factors like force, angle, and surface characteristics.

4. Types of Dice:
While the six-sided die is the most common, there are also dice with
different numbers of faces, such as four-sided (D4), eight-sided (D8),
ten-sided (D10), twelve-sided (D12), and twenty-sided (D20), among
Role-playing games (RPGs) often use a variety of dice to simulate
different levels of randomness and outcomes.
PROBLEM STATEMENT

 In the world of board games, dice have


been the most common thing linking most of
the board games. We end up losing the dice
because of their small size. How about building
a dice that we cannot lose. Let’s create a dice
rolling simulator in python.
IMPLEMENTATION
Source code:
import random
from tkinter import *
root = Tk()
root.geometry('600x600')
root.title(' Roll Dice')
#label to print result
label = Label(root, text='', font=('Helvetica', 260))
#label to introduce
label2 = Label(root, text='Click to roll dice ', font=('Helvetica',10))
label2.place(x=250,y=400)
def roll_dice():
value = ['\u2680', '\u2681', '\u2682', '\u2683', '\u2684', '\u2685']
result=random.choice(value)
label.configure(text=result)
label.pack() if(result=='\
u2680'):
label3=Label(root,text='You rolled a one! Click roll dice to roll
again.',font=('Helvetica',10))
label3.place(x=150,y=450)
elif(result=='\u2681'):
label3=Label(root,text='You rolled a two! Click roll dice to roll
again.',font=('Helvetica',10))
label3.place(x=150,y=450)
elif(result=='\u2682'):
label3=Label(root,text='You rolled a three! Click roll dice to roll
again.',font=('Helvetica',10))
label3.place(x=150,y=450)
elif(result=='\u2683'):
label3=Label(root,text='You rolled a four! Click roll dice to roll
again.',font=('Helvetica',10))
label3.place(x=150,y=450)
elif(result=='\u2684'):
label3=Label(root,text='You rolled a five! Click roll dice to roll
again.',font=('Helvetica',10))
label3.place(x=150,y=450)
elif(result=='\u2685'):
label3=Label(root,text='You rolled a six! Click roll dice to roll
again.',font=('Helvetica',10))
label3.place(x=150,y=450)
button = Button(root, text='roll dice', foreground='red', command=roll_dice)
button.pack()
root.mainloop()
Output:
CONCLUSION:
We have successfully created python dice rolling simulator. We have
learned the use of the classes: random – to generate random numbers
when we roll dice and Tkinter: to create a simple user interface. We
also learned the basics of classes. Now you can get back to board
games using this dice rolling simulator.

You might also like