A
Micro Project Report
On
Dice Roll Simulator
Under Course: Programming With Python(22616)
Semester: VI
Maharashtra State Board of Technical Education, Mumbai
Department of Computer
(Computer Engineering)
Matoshri Aasarabai Polytechnic, Eklahare, Nashik
Academic Year: 2024-25
1
Maharashtra State Board of Technical Education, Mumbai
Matoshri Aasarabai Polytechnic, Eklahare, Nashik
CERTIFICATE
This is to certify that following students of SIXTH SEMESTER Diploma Engineering
in Computer have successfully completed the Micro-Project entitled “Dice Roll
Simulator With Python ” under my supervision, in the partial fulfillment of Course
Programming With Python for Academic Year 2024-202 as per prescribed in the
MSBTE “I-Scheme” curriculum.
Roll No Enrollment No. Exam Seat Name of Students
Number
8 2211700088 443656 Bonde Vaibhav Narendra
9 2211700091 443657 Chavan Omkar Rajesh
13 2211700096 443661 Dhas Aditya Abhijeet
41 2211700125 443689 Panbude Sarthak Milind
Date: Place: Nashik.
Guide Head of Department Principal
(Ms.N.R.Jadhav) (Prof.V.A.Sonawane) (Dr.S.J.Bagul)
2
ACKNOWLEDGEMENT
With deep sense of gratitude we would like to thanks all the people who have lit
our path with their kind guidance. We are very grateful to these intellectuals who
did their best to help during our project work.
It is our proud privilege to express deep sense of gratitude to, Dr. S. J. Bagul
Principal of Matoshri Aasarabai Polytechnic, Eklahare, Nashik, for his
comments and kind permission to complete this Micro Project.
We remain indebted to Prof.V.A.Sonawane, Head of Computer Department., for
his suggestion and valuable guidance.
The special gratitude goes to our internal guide Ms.N.R.Jadhav, technical staff
members, and non-technical staff members, of Computer Department for their
expensive, excellent and precious guidance in completion of this work.
Name of Students:
1. Bonde Vaibhav Narendra
2. Chavan Omkar Rajesh
3. Dhas Aditya Abhijeet
4. Panbude Sarthak Milind
3
MATOSHRI AASARABAI POLYTECHNIC, EKLAHARE, NASHIK
Department of Computer
Index of Micro Project Report
Programme: CO3I Semester: Third
Course: OOP Course Code: 22316
Title of Micro Project : File Handling Through C++ Classes
Sr.
Details Page No.
No.
Rubrics
1 5
2 Logbook 7
3 Project Work (Introduction) 10
Project Work (Main Details)
4 11
5 Project Work (Conclusion) 22
Signature of Faculty
4
ANNEXURE-I
Rubric for Evaluation of Micro Project Object Oriented Programing( (22316)
Title of Micro Project:: File Handling Through C++ Classes
Group Members: 4
Roll Enrollment Exam Seat
Sr.No. Name of Students
No. No. No.
8 2211700088
1 443656 Bonde Vaibhav Narendra
9 2211700091
2 443657 Chavan Omkar Rajesh
13 2211700096 443661
3 Dhas Aditya Abhijeet
41 2211700125 443689
4 Panbude Sarthak Milind
Indicators for different level of
Marks performance(Evaluation Scale -1 to 6)
Sr. Criteria obtained
No. (Out of 6) Poor(1-2) Average(3-4) Good(5-6)
1 Relevance to the Course Not at all related Few subtopics Project topic is
to the course are related to the from the course.
course.
2 Project Proposal Not submitted Late Submitted Submitted in the
first week
3 Completion of target as per Submitted after Submitted Submitted
proposal due date. within due date complete project
but taken within specified
slightly more due date.
time.
4 Quality of Project Poor quality Average quality Good quality
project project project
5 Report Preparation Not done. Done but not Completed and
satisfactory. submitted in
time.
Total:
Converted Out of 6:
Ms.N.R.Jadhav
(Name & Sign of Course Teacher/Guide)
5
ANNEXURE II
Evaluation Sheet for the Micro Project
Academic Year: 2023-2024 Semester: THIRD
Course: Object Oriented Programing Course Code: 22316
Name of Faculty: Ms.N.R.Jadhav
Title of the Project: “Develop a Miniature Tic-Tac-Toe Game”
COs addressed by the Micro Project:
a.
b.
c.
.Major Learning Outcomes achieved by students by doing the Projects:
a) Practical Outcomes:-
_.
_.
b) Unit Outcomes in Cognitive Domain:-
_.
_.
c) Outcomes in Affective Domain:-
_.
_.
Comment /Suggestion about team work /Leadership/ Inter-personal communication
.
Marks out
Marks out of 4for
of 6 for Total
Roll Exam performance in
Enrollment No. Student Name performance marks
No. Seat No. oral/presentatio
in group out of 10
n activity
activity
08 2211700088
443656 Bonde Vaibhav Narendra
09 2211700091 443657 Chavan Omkar Rajesh
13 2211700096 443661
Dhas Aditya Abhijeet
41 2211700125 443689
Panbude Sarthak Milind
Ms.N.R.Jadhav
(Name & Sign of Faculty)
6
MATOSHRI AASARABAI POLYTECHNIC,EKLAHARE,NASHIK
Department of Computer
Log Book for Micro- Project
Semester: Third Programme: CO3I
Course: Object Oriented Programing Class: Second Year
Topic of the Micro- Project: Handling Through C++ Classes
Sr. Roll Enrollment Exam
Name of Group Members Sign.
No. No. No. Seat No.
08 2211700088
1 443656 Bonde Vaibhav Narendra
09 2211700091
2 443657 Chavan Omkar Rajesh
13 2211700096 443661
3 Dhas Aditya Abhijeet
41 2211700125 443689
4 Panbude Sarthak Milind
Week Members Teacher’s Teacher’s
Discussion & Details
No. Present Comment Sign.
Discussion on the concept of Micro Discussed micro
1 4
project with teacher project concept
Finalization of Group and Project topic
2 4 Finalized the group
with Project Proposal submission
Preliminary discussion with guide about 4 Discussed with
3
content of Micro project guide
Related Information Gathered by team 4 Gathered
4
about project information
Organizing the information for project 4 Organized the
5
work information
6
Discussing project related queries with 4 Discussed the
teacher if any queries
Preparation of Micro project model or 4 Prepared micro
7
content project
8 Finalizing the project work by teacher 4 Finalized project
work
9 Report writing 4 Completed report
writing
10
Presentation and Oral on project by 4 GavePresentation
group members submitted project .
Ms.N.R.Jadhav
Name & Sign of Course Teacher/Guide
7
Write project Report in following sequence:-
1. Abstract (250 words or less )
2. Introduction and Purpose :-
(Sometimes this section is called 'Background'. Whatever its name, this section
introduces the topic of the project, notes any information already available, explains
why you are interested in the project, and states the purpose of the project.)
3. Materials and Methods:-
(List the materials you used in your project and describe the procedure that you used
to perform the project. If you have a photo or diagram of your project, this is a good
place to include it.)
4. Theoretical Background
Explicitly state your hypothesis or Law, Definition or Explanation of subject
topic you can understand under this project.
5. Practical Application
What is the importance of this study? Of what use is a study such as this?
6. Bibliography
Use proper citing format for books, journals, and websites.
Websites should include author of article if given, title of article and the date
the article was posted or retrieved from website.
NOTE: Must have at least 5 reliable resources.
8
Abstract
The Dick Roll Simulator is a Python-based
program that mimics the concept of "Rickrolling" but with a
humorous twist. The simulator generates a randomized set of
unexpected, meme-inspired events that playfully deceive or
surprise users, incorporating text-based interactions, sound effects,
and optional graphical elements.
Built using Python, the project utilizes libraries such
as random for event generation pygame for audio playback, and
tkinter or curses for a simple GUI or terminal-based
interface. The simulator can display fake loading screens, redirect
users to humorous content, or play an unexpected sound or video
clip, enhancing the comedic effect. Additionally, user inputs may
trigger randomized responses, making each simulation unique.
This project serves as an entertaining
programming experiment that explores Python's capabilities in
interactive applications, randomization, and multimedia
integration. It can also be extended to include machine learning for
personalized prank responses or network functionalities for online
interactions. The Dick Roll Simulator is an amusing and engaging
example of how programming can be used to create lighthearted
digital pranks.
9
Introduction
The Dick Roll Simulator is a Python-based prank
program designed to surprise users with unexpected and humorous
interactions, much like the concept of "Rickrolling." Instead of
redirecting users to Rick Astley's famous song, this simulator takes
a creative approach by generating randomized events, fake system
messages, or meme-inspired outputs to playfully trick users.
Using Python, the simulator leverages libraries such as
random for unpredictable behaviors, pygame for sound playback,
and tkinter or curses for graphical or terminal-based
interactions. The goal is to create an engaging and amusing
experience where users never know what will happen next—
whether it's a fake loading screen, an absurd message, or an
unexpected sound effect.
The project serves as a fun experiment in Python
programming, showcasing the power of randomness, multimedia
integration, and interactive scripting. It can be further expanded
with AI-driven responses, network interactions, or even game-like
elements. The Dick Roll Simulator is an entertaining demonstration
of how coding can be used for humor and engagement, making it a
great project for both beginners and experienced programmers
looking to create something lighthearted and fun.
10
Theoratical Background
File handling is used to store data permanently in a computer. Using file
handling we can store our data in secondary memory (Hard disk).
How to create Dice Roll Simulator
For creating Dice Roll Simulator we need to follow the following
steps:-
STEP 1-Install Necessary Libraries
STEP 2-Import Required Modules
STEP 3-Define Randomize Prank
Event
STEP 4-Implement Text-Based Prank
Messages
STEP 5-Implement a GUI Based
Popup Prank
STEP 6-Implement a Sound Based
Prank
STEP 7-Implement a Fake Error
Message
STEP 8-Implement a Video
Playback
STEP 9-Run the Simulator
STEP 10-Run and Test
Libraries in Python :-
A library in Python is a collection of pre-written modules or functions that
help programmers perform specific tasks efficiently without writing code
from scratch. Python libraries simplify development by providing reusable
code for various functionalities such as mathematics, data manipulation,
networking, machine learning, and more. known as “disk I/O operation”.
11
Types of Libraries in Python:-
Python libraries can be categorized into different types based on their
purpose:
1. Built-in Libraries – Pre-installed with Python (e.g., math, os, random,
sys).
2. Third-Party Libraries – External libraries that need to be installed
using pip (e.g., numpy, pandas, requests).
3. Custom Libraries – User-defined modules and packages that contain
reusable code.
Libraries for Dice Roll Simulator :-
To build the Dick Roll Simulator, we require several Python libraries to
handle different functionalities like randomization, sound playback, GUI
pop-ups, and video display. Below is a list of essential libraries along with
their explanations:-
1. random (Built-in) – For Random Event Generation
Used to randomly select prank events (text, sound, popup, video).
Helps make the simulator unpredictable.
Example:-
import random
prank = random.choice(["popup", "sound", "text"])
2. pygame (Third-Party) – For Sound Playback:-
Provides functionality to play audio files.
Used for playing unexpected sound effects or background music.
Installation:-
pip install pygame
12
Example:-
import pygame
pygame.mixer.init()
pygame.mixer.music.load("rickroll.mp3") # Load prank sound
pygame.mixer.music.play()
3. tkinter (Built-in) – For GUI Popups:-
Used to create pop-up messages and fake alerts.
Helps display warnings or prank notifications.
Example:-
import tkinter as tk
from tkinter import messagebox
root = tk.Tk()
root.withdraw() # Hide main window
messagebox.showinfo("Surprise!", "You've been Dick Rolled!")
4. cv2 (OpenCV) (Third-Party) – For Video Playback:-
Handles video display for meme or Rick Roll clips.
Can play .mp4 or .gif files in a window.
Installation:-
pip install opencv-python
13
Example:-
import cv2
cap = cv2.VideoCapture("meme_video.mp4")
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
cv2.imshow("Dick Roll!", frame)
if cv2.waitKey(25) & 0xFF == ord("q"):
break
cap.release()
cv2.destroyAllWindows()
5. time (Built-in) – For Delays & Fake Loading Screens:-
Used for adding fake progress bars or countdowns.
Example:-
import time
print("Loading... Please wait.")
time.sleep(3) # Wait for 3 seconds
print("Just kidding! You've been pranked!")
14
1. Modules Needed for Dick Roll Simulator in Python:-
A module in Python is a file containing reusable functions, classes, and
variables that help organize code into manageable sections. The Dick Roll
Simulator requires several modules to handle randomization, multimedia
playback, and user interactions. Below is a list of essential modules along with
their explanations.
1. random (Built-in) – For Random Prank Selection:-
Used to randomly select prank events (e.g., popups, sounds, text
messages).
Ensures unpredictability in the simulator.
Example:-
import random
prank = random.choice(["popup", "sound", "video"])
print(f"Selected Prank: {prank}")
15
2. pygame.mixer (Third-Party) – For Sound Playback:-
Handles audio playback for meme sounds or Rick Roll music.
Provides functions to load and play .mp3 or .wav files.
Installation:-
pip install pygame
Example:-
import pygame
pygame.mixer.init()
pygame.mixer.music.load("rickroll.mp3") # Load sound
pygame.mixer.music.play()
3. tkinter (Built-in) – For GUI Popups and Alerts:-
Displays pop-up messages or fake warnings to prank users.
Example:-
import tkinter as tk
from tkinter import messagebox
root = tk.Tk()
root.withdraw() # Hide the main window
messagebox.showinfo("Surprise!", "You've been Dick Rolled!")
16
4. cv2 (OpenCV) (Third-Party) – For Video Playback:-
Used to display meme videos or Rick Roll clips.
Can handle .mp4, .avi, and .gif formats.
Installation:-
pip install opencv-python
Example:-
import cv2
cap = cv2.VideoCapture("rickroll.mp4")
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
cv2.imshow("Dick Roll!", frame)
if cv2.waitKey(25) & 0xFF == ord("q"):
break
cap.release()
cv2.destroyAllWindows()
5. time (Built-in) – For Delays and Fake Loading Screens
Used to create fake progress bars or delays before pranking the
user.
Example:-
17
import time
print("Loading... Please wait.")
time.sleep(3) # Wait for 3 seconds
print("Just kidding! You've been pranked!")
6. os (Built-in) – For System Commands (Optional):-
Can be used to open prank websites, play videos, or execute
system-level commands.
Example:-
import os
os.system("start https://www.youtube.com/watch?v=dQw4w9WgXcQ") #
Opens Rickroll video in browser
7. webbrowser (Built-in) – For Opening Links:-
Redirects users to funny or prank websites automatically
Example:-
import webbrowser
webbrowser.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
# Rickroll link
18
Randomized Prank Events:-
1. Random Pop-up Message (Using tkinter)
A pop-up appears with a fake warning or funny message.
Example:-
import tkinter as tk
from tkinter import messagebox
import random
def popup_prank():
messages = [
"Warning: Virus Detected! Just Kidding 😂",
"System Overheating... NOT!",
"You've been Dick Rolled!",
"Congratulations! You've won nothing!"
19
]
root = tk.Tk()
root.withdraw()
messagebox.showinfo("Alert!", random.choice(messages))
popup_prank()
2. Random Sound Prank (Using pygame)
Plays a random sound file to startle the user.
Example:-
import pygame
import random
def sound_prank():
pygame.mixer.init()
sounds = ["rickroll.mp3", "funny_sound.mp3", "scream.mp3"] # Replace
with actual files
pygame.mixer.music.load(random.choice(sounds))
pygame.mixer.music.play()
sound_prank()
20
3. Random Fake Error Message (Using tkinter)
Displays a fake error warning.
Example:-
import tkinter as tk
from tkinter import messagebox
def fake_error():
root = tk.Tk()
root.withdraw()
messagebox.showerror("Error 404", "System Failure: Please Restart
Immediately!")
fake_error()
4. Random Meme Video (Using cv2)
Plays a random meme video.
Example:-
import cv2
import random
def video_prank():
videos = ["rickroll.mp4", "funny_clip.mp4"] # Replace with actual files
21
cap = cv2.VideoCapture(random.choice(videos))
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
cv2.imshow("Surprise Video!", frame)
if cv2.waitKey(25) & 0xFF == ord("q"):
break
cap.release()
cv2.destroyAllWindows()
video_prank()
Text-Based Prank Messages
1. Fake Hacking Prank
Displays a fake hacking message with a dramatic effect.
Example:-
import time
22
def fake_hack():
print("Initializing Hack...")
time.sleep(2)
print("Connecting to FBI servers...")
time.sleep(2)
print("Downloading confidential files...")
time.sleep(3)
print("Just kidding! You've been pranked! 😂")
fake_hack()
2. Fake System Crash Message
Pretends that the system is shutting down
Example:-
import time
def fake_crash():
print("Critical Error: System Malfunction Detected!")
time.sleep(2)
print("Attempting to repair...")
time.sleep(3)
23
print("Repair Failed. Restarting system in 3... 2... 1...")
time.sleep(3)
print("Just kidding! 😆")
fake_crash()
3. Fake Virus Installation
Scares the user by pretending to install a virus.
Example:-
import time
def fake_virus():
print("Downloading virus...")
time.sleep(3)
print("Installing ransomware...")
time.sleep(3)
print("Encrypting files...")
time.sleep(3)
print("Error! Virus failed to install. Just kidding! 😂")
fake_virus()
24
GUI-Based Popup Prank
1. Random Popup Prank
This script displays a random popup message to prank the
user.
Example:-
import tkinter as tk
from tkinter import messagebox
import random
def popup_prank():
messages = [
"Warning: Virus Detected! 🔥 Just Kidding 😂",
"System Error 404: You’ve Been Pranked!",
"Congratulations! You’ve won NOTHING! 🎉",
"Hacking in Progress... NOT! 😆",
"Your PC will shut down in 3...2...1... Just Kidding!"
root = tk.Tk()
root.withdraw() # Hide the main window
messagebox.showinfo("Alert!", random.choice(messages)) # Show
prank message
25
popup_prank()
2. Fake Windows Error Prank
A fake error message that looks like a system crash.
Example:-
import tkinter as tk
from tkinter import messagebox
def fake_error():
root = tk.Tk()
root.withdraw() # Hide main window
messagebox.showerror("Critical Error!", "System32 not found! Your PC
may be at risk! 😱")
fake_error()
3. Endless Loop of Pop-ups (Annoying Prank 😂)
Keeps spamming pop-ups until the user closes the script.
Example:-
import tkinter as tk
from tkinter import messagebox
import random
26
def spam_popups():
messages = [
"System Failure! 😱",
"Warning: Self-Destruct in 10s... Just Kidding! 😂",
"Congratulations! You’ve won... NOTHING! 🎉",
"Your PC has been hacked! (Not really 😆)",
"You just got Rick Rolled!"
root = tk.Tk()
root.withdraw()
while True: # Infinite loop to keep showing popups
messagebox.showwarning("ALERT!", random.choice(messages))
spam_popups()
Video Playback Pranks
1. Play a Meme Video Automatically
This prank will open and play a funny video using OpenCV.
27
Example:-
import cv2
def play_video():
video_path = "rickroll.mp4" # Replace with your video file
cap = cv2.VideoCapture(video_path)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
cv2.imshow("Surprise Video!", frame)
if cv2.waitKey(25) & 0xFF == ord("q"): # Press 'q' to exit
break
cap.release()
cv2.destroyAllWindows()
play_video()
28
2. Auto-Open Rick Roll Video in Browser
This prank opens a Rick Astley video in the default web
browser.
Example:-
import webbrowser
def open_rickroll():
url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ" # Rick
Roll link
webbrowser.open(url) # Opens in browser
open_rickroll()
3. Delayed Video Prank (Fake Loading + Rick Roll)
This prank pretends to load something serious, then plays
a prank video.
Example:-
import time
import cv2
def delayed_video_prank():
print("Loading important security update...")
time.sleep(5) # Fake loading delay
29
print("Update complete! Opening security footage...")
video_path = "rickroll.mp4" # Replace with your video file
cap = cv2.VideoCapture(video_path)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
break
cv2.imshow("Security Footage", frame)
if cv2.waitKey(25) & 0xFF == ord("q"):
break
cap.release()
cv2.destroyAllWindows()
delayed_video_prank()
30
Dice Roll Simulator Program:-
import random # Importing the random module to generate random
numbers
# Dictionary to map numbers to dice face symbols
dice_faces = {
1: "⚀",
2: "⚁",
3: "⚂",
4: "⚃",
5: "⚄",
6: "⚅"
def roll_single_dice():
"""
Function to roll a single six-sided dice and display the result.
"""
value = random.randint(1, 6) # Generate a random number between 1
and 6
print(f"\n🎲 You rolled: {dice_faces[value]} ({value})\n") # Print the
result with an emoji
31
def roll_multiple_dice(n):
"""
Function to roll multiple dice and show results.
:param n: Number of dice to roll.
"""
print(f"\n🎲 Rolling {n} dice...\n")
for i in range(n):
value = random.randint(1, 6)
print(f"Roll {i+1}: {dice_faces[value]} ({value})") # Display each
roll with emoji
def interactive_dice_roller():
"""
Interactive mode where the user can roll the dice multiple times.
"""
while True:
input("\n🎲 Press Enter to roll the dice... (or type 'exit' to quit) ")
roll_single_dice() # Call the function to roll a single dice
# Ask if the user wants to roll again
choice = input("Roll again? (y/n): ").lower()
32
if choice != "y":
print("Goodbye! 🎲")
break # Exit the loop if user chooses not to roll again
# Main Program
if __name__ == "__main__":
print("🎲 Welcome to the Dice Roll Simulator! 🎲\n")
while True:
print("\nChoose an option:")
print("1. Roll a single dice")
print("2. Roll multiple dice")
print("3. Play interactive dice roller")
print("4. Exit")
option = input("\nEnter your choice (1-4): ")
if option == "1":
roll_single_dice() # Roll one dice
elif option == "2":
num = int(input("\nHow many dice do you want to roll? "))
33
roll_multiple_dice(num) # Roll multiple dice
elif option == "3":
interactive_dice_roller() # Start interactive mode
elif option == "4":
print("\nThanks for playing! 🎲 Goodbye!\n")
break # Exit the program
else:
print("\nInvalid choice! Please enter a number between 1 and 4.")
Output:-
🎲 Welcome to the Dice Roll Simulator! 🎲
Choose an option:
1. Roll a single dice
2. Roll multiple dice
3. Play interactive dice roller
4. Exit
Enter your choice (1-4): 1
🎲 You rolled: ⚃ (4)
34
Conclusion
The Dice Roll Simulator is a simple yet fun Python program that mimics
rolling a six-sided dice. It provides users with multiple options, including:
✅ Rolling a single dice with a visual emoji representation.
✅ Rolling multiple dice at once for more randomness.
✅ An interactive mode where users can roll continuously.
By utilizing randomization (random.randint), the program ensures fair
and unpredictable dice rolls. The use of ASCII symbols (⚀⚁⚂⚃⚄⚅)
enhances the user experience by visually representing the dice outcome.
This project is an excellent beginner-friendly example of using **Python’s
random module, functions, loops, and conditionals**. It can also be
extended by adding: ✔️ More dice types (e.g., 8-sided, 20-sided). ✔️
Sound effects for rolling. ✔️ A GUI interface using tkinter`.
Overall, this Dice Roll Simulator is a fun and interactive way to explore
Python programming! 🎲🚀
35
Reference Links
1) https://github.com/shamil-ibrahim/Beginner-Python/blob/master/dice-
rolling-simulator.py
2) https://chatgpt.com/c/67e83354-138c-800d-a9ef-8aa4412d663f
36