Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a crazy birthday python script. #252

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions examples/crazy_birthday.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
######################################
# _____ ______ _ _ _ _
#/ __ \ | ___ (_) | | | | | |
#| / \/_ __ __ _ _____ _ | |_/ /_ _ __| |_| |__ __| | __ _ _ _
#| | | '__/ _` |_ / | | | | ___ \ | '__| __| '_ \ / _` |/ _` | | | |
#| \__/\ | | (_| |/ /| |_| | | |_/ / | | | |_| | | | (_| | (_| | |_| |
# \____/_| \__,_/___|\__, | \____/|_|_| \__|_| |_|\__,_|\__,_|\__, |
# __/ | ~Crazy Birthday~ __/ |
# |___/ by joshuqa aka Roni |___/
#
# GitHub: https://github.com/nobalpha
######################################

import random

# Contstants
candle_width = 2
candle_height = 4
space_width = 2

# Pre-function calls
alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
arr = list("Happy Birthday")
random.shuffle(arr)

# Input
name = input("Whom I'm wishing happy birthday? : ")
age = int(input("How old are you? : "))

# Deriveds
space_count = age + 1
cake_height = 2 * candle_height
height = cake_height + candle_height
width = (candle_width * age) + (space_width * space_count)

# Crazy Celebration
print("")
print("".join(arr), name)
print("")

## Birthday Cake section

# Candle section
for _ in range(candle_height):
print(" " * space_width, end="")
for _ in range(age):
for i in range(candle_width):
print(alp[random.randint(0,len(alp)-1)], end="")
print(" " * space_width, end="")
print("")

# Cake section
for _ in range(cake_height):
for _ in range(width):
print(alp[random.randint(0,len(alp)-1)], end="")
print("")