You are on page 1of 11

A

MICRO-PROJECT REPORT ON
“Dice roll simulator”

Submitted by
Guided by:

Computer Engineering Department


Academic Year 2023 2024
Index:
1.Introduction
2.software reqirement
3.Flowchart
4.Source code
5.Output
6. Advantages and disadvantage(only 1)
7. Conclusion
8.References
Introduction:
The Dice is a simple cube shaped like object used in various board games such as snake- ladder, Ludo etc. It is a
simple cube which generates a random number when rolled by a user. A Dice rolling simulator is nothing but a
computer model that can be created by a software program and it functions same as a normal dice in which user
rolls a dice and a random number gets shown on the screen. There are many ways a dice simulator can be
implemented. In this paper, we will implement a GUI Application of dice simulator using in PPython

What is Tkinter?

Python has various frameworks/packages which can be used for making GUI applications i.e., the
Graphical User Interface. Tkinter is the standard GUI package for Python. It is the most common, fast, and easy
way to create a GUI (Graphical User Interface) application. It provides a powerful object-oriented interface to the
Tk GUI toolkit. We can develop an application and can use that application on any platform, which reduces the
need for additional requirements required to use an application on any OS like Windows, Mac, or Linux.

Page 1
Software requirement:
• computer system : ( i3-I parfalable RAM> 2 GB)

• Operating system: windows/LLinux

•Devlopment : python ID

Page 2
Flowchart:

Page 3
Source code:
import random

x = "y"

while x == "y":

# Generates a random number


# between 1 and 6 (including
# both 1 and 6)
no = random.randint(1,6)

if no == 1:
print("[ ---- ]")
print("[ ]")
print("[ 0 ]")
print("[ ]")
print("[ ---- ]")
if no == 2:

Page 4
print("[ ----]")
print("[ 0 ]")
print("[ ]")
print("[ 0 ]")
print("[ ---- ]")
if no == 3:
print("[ ---- ]")
print("[ ]")
print("[0 0 0]")
print("[ ]")
print("[ ---- ]")
if no == 4:
print("[ ---- ]")
print("[0 0]")
print("[ ]")
print("[0 0]")
print("[ ---- ]")
if no == 5:
print("[ ---- ]")
print("[0 0]")
print("[ 0 ]")
print("[0 0]")

Page 5
print("[ ----]")
if no == 6:
print("[ ---- ]")
print("[0 0 0]")
print("[ ]")
print("[0 0 0]")
print("[ ---- ]")

x=input("press y to roll again and n to exit:")


print("\n")

Output:

Page 6
Advantage and disadvantage
(only1)
The Advantages of Dice Pools
The dice pool offers a number of advantages as a core mechanic, and to
discuss them I am going to get a bit mathy, so consider yourself
warned. The biggest and most immediate advantage is that die pools
create a bell curve. That is, the average roll from a number of dice is
going to be the most likely, with the extreme high and low numbers
being the least likely. For example, the most common numbers to come
up on a roll of 5d6 are 17 or 18. The least common are 5 and 30. This
means that while flukes do happen, they are appropriately rare. In a
static die system, such flukes are much more common. Using a single
d20 means that a 1 is just as likely as a 20, or any number in between.
The practical effect of this is that in a dice pool system, characters are
less likely to flub a roll they should be able to pass, or succeed a roll
that should be far beyond them.

Another major advantage of a dice pool system is that a character’s


abilities are always appropriately relevant. Said abilities determine the
number of dice rolled, and thus will always effect the random number
generated. In the example of a single d20, a low level character may
only add +4 to the roll, while a high level one might add as much as +20.
The low level character’s skill barely effects the roll at all, while the high
level character’s skill is actually more important than the roll itself.

Page 7
Conclusion:
Yay! We have successfully developed a cool application – Dice Rolling
Simulator in Python. Now, you can just click on a button and get your
next number. Cheers to Python and its package ‘Tkinter’ which supports
functions and makes our work easy. Who would have thought that we
can develop an application by only the ‘random’ function of python? As
of now, we have an understanding of Python, Tkinter, and random
function.

Reference:
https://en.wikipedia.org/wiki/Tkinter

https://www.tutorialspoint.com/python/python_gui_programming.h
tm

https://www.w3schools.com/python/ref_random_choice.asp

https://data-flair.training/blogs/dice-rolling-simulator-python/

https://pillow.readthedocs.io/en/stable/reference/ImageTk.html

http://clipart-library.com/dice-faces.html

Page 8

You might also like