Spaces:
Sleeping
Sleeping
Create app.py
Browse filesLove ["πΆ", "π±", "π"]
app.py
ADDED
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import math
|
3 |
+
|
4 |
+
# Define the story and the emojis
|
5 |
+
story = "Once upon a time in the magical land of Emojiville, a quirky dog πΆ, a mischievous cat π±, and an intelligent graph π lived in harmony..."
|
6 |
+
emojis = ["πΆ", "π±", "π"]
|
7 |
+
|
8 |
+
# Define tree dimensions
|
9 |
+
tree_height = 5 * 12 + 11 # Convert to inches (71 inches)
|
10 |
+
tree_base_radius = 24 # Assume a 24-inch radius at the base of the tree
|
11 |
+
tree_top_radius = 4 # Assume a 4-inch radius at the top of the tree
|
12 |
+
|
13 |
+
# Calculate the circumference of the tree at different heights
|
14 |
+
num_spiral_levels = 10 # Define the number of levels for the spiral
|
15 |
+
spiral_circumferences = []
|
16 |
+
for level in range(num_spiral_levels):
|
17 |
+
st.markdown()
|
18 |
+
height_ratio = level / (num_spiral_levels - 1)
|
19 |
+
st.markdown(height_ratio)
|
20 |
+
height = height_ratio * tree_height
|
21 |
+
st.markdown(height)
|
22 |
+
radius = tree_base_radius - height_ratio * (tree_base_radius - tree_top_radius)
|
23 |
+
st.markdown(radius)
|
24 |
+
circumference = 2 * math.pi * radius
|
25 |
+
st.markdown(circumference)
|
26 |
+
spiral_circumferences.append((height, circumference))
|
27 |
+
st.markdown(spiral_circumferences)
|
28 |
+
|
29 |
+
# Decorate the tree with the story and emojis
|
30 |
+
story_index = 0
|
31 |
+
emoji_index = 0
|
32 |
+
story_decorations = []
|
33 |
+
|
34 |
+
for height, circumference in spiral_circumferences:
|
35 |
+
num_chars = int(circumference) // 2 # Assume each decoration takes 2 inches of space
|
36 |
+
level_decorations = ""
|
37 |
+
|
38 |
+
for _ in range(num_chars):
|
39 |
+
if story_index < len(story):
|
40 |
+
level_decorations += story[story_index]
|
41 |
+
story_index += 1
|
42 |
+
else:
|
43 |
+
level_decorations += emojis[emoji_index]
|
44 |
+
emoji_index = (emoji_index + 1) % len(emojis)
|
45 |
+
|
46 |
+
story_decorations.append((height, level_decorations))
|
47 |
+
|
48 |
+
# Display the decorated tree
|
49 |
+
for height, decorations in story_decorations:
|
50 |
+
print(f"Height: {height:.2f} inches - Decorations: {decorations}")
|
51 |
+
|
52 |
+
st.markdown("""
|
53 |
+
Introduction
|
54 |
+
a. Dog πΆ, Cat π±, and Graph π are three unlikely friends who share unique and hilarious adventures together.
|
55 |
+
b. Dog is a playful, energetic, and loyal creature named Barky McTailwag.
|
56 |
+
c. Cat is a curious, mischievous, and graceful feline named Whiskers Purrington.
|
57 |
+
d. Graph is an intelligent, resourceful, and animated data visualization named Chartly Plotsworth.
|
58 |
+
|
59 |
+
Backstory
|
60 |
+
a. Barky, Whiskers, and Chartly first met when they were brought together by a mysterious power to save their world from boredom.
|
61 |
+
b. The trio quickly bonded and started sharing exciting adventures, forming a deep and enduring friendship.
|
62 |
+
|
63 |
+
Adventure 1: The Great Pancake Heist π₯
|
64 |
+
a. The friends discover a pancake recipe that will bring joy to the world.
|
65 |
+
b. The recipe is locked away in a hidden vault, and they must work together to retrieve it.
|
66 |
+
c. Barky uses his agility to bypass traps, Whiskers uses cunning to pick locks, and Chartly deciphers codes.
|
67 |
+
d. They successfully steal the recipe and share the pancakes with everyone, spreading happiness.
|
68 |
+
|
69 |
+
Adventure 2: The Emoji Parade π
|
70 |
+
a. The friends learn of an annual Emoji Parade that celebrates their world's most beloved characters.
|
71 |
+
b. They decide to join in and design their own parade float.
|
72 |
+
c. They each contribute their unique talents: Barky builds the float, Whiskers sews costumes, and Chartly plans the route.
|
73 |
+
d. Their float is a hit at the parade, making them local celebrities.
|
74 |
+
|
75 |
+
Adventure 3: The Mysterious Island ποΈ
|
76 |
+
a. The trio stumbles upon a treasure map leading to a secret island.
|
77 |
+
b. They embark on a daring journey by sea, overcoming storms, sea monsters, and pirate encounters.
|
78 |
+
c. Upon arriving, they find an ancient temple filled with priceless artifacts and knowledge.
|
79 |
+
d. They return home, sharing their newfound wisdom with their community.
|
80 |
+
|
81 |
+
Dramatic Peak: The Battle of Laughter π
|
82 |
+
a. A powerful sorcerer threatens to drain all laughter from the world.
|
83 |
+
b. Barky, Whiskers, and Chartly are summoned to stop him.
|
84 |
+
c. The trio must pass various trials and tribulations to reach the sorcerer's lair.
|
85 |
+
d. They use their combined humor and wit to defeat the sorcerer, restoring laughter to the world.
|
86 |
+
|
87 |
+
Adventure 4: The Time-Traveling Odyssey β
|
88 |
+
a. The friends discover a time machine that sends them on a wild journey through history.
|
89 |
+
b. They visit prehistoric times, ancient civilizations, and futuristic cities.
|
90 |
+
c. Barky, Whiskers, and Chartly learn from their experiences and gain a newfound appreciation for the present.
|
91 |
+
d. They return home, eager to share their tales with their friends and family.
|
92 |
+
|
93 |
+
Adventure 5: The Great Space Race π
|
94 |
+
a. The friends are recruited for a space mission to explore new planets.
|
95 |
+
b. They train rigorously and learn valuable skills, such as piloting a spaceship and conducting scientific experiments.
|
96 |
+
c. They discover a friendly alien civilization and establish a peaceful alliance.
|
97 |
+
d. The friends return to their world, sharing their experiences and knowledge.
|
98 |
+
|
99 |
+
Adventure 6: The Talent Show Extravaganza π
|
100 |
+
a. Barky, Whiskers, and Chartly decide to showcase their skills at a local talent show.
|
101 |
+
b. They brainstorm and practice a hilarious comedy skit
|
102 |
+
|
103 |
+
["πΆ", "π±", "π"]
|
104 |
+
|
105 |
+
|
106 |
+
""")
|