awacke1 commited on
Commit
b942871
ยท
1 Parent(s): 3df83f0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +70 -0
app.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ st.markdown("""
4
+ | Story | Outline |
5
+ |-------|---------|
6
+ | The Celestial Gatekeepers โ˜„๏ธ๐ŸŒŸ๐Ÿ›ก๏ธ | <ul><li>Beginning: ๐ŸŒŒ Stella, the starry-eyed guardian, and her celestial companions are tasked with protecting the universe from cosmic threats.</li><li>Middle: ๐Ÿ˜‡๐Ÿ‘ฟ As the team battles otherworldly foes, they must also confront their own inner demons and navigate the complex relationships within their ranks.</li><li>End: โš”๏ธ๐ŸŒ‘ The Gatekeepers face a powerful and ancient force of darkness, ultimately triumphing and strengthening their bonds as a team.</li></ul> |
7
+ | The Children of the Forgotten Gods โšก๐Ÿ‰๐Ÿบ | <ul><li>Beginning: ๐Ÿบ In a world where the old gods have been forgotten, Theo the Thunder-Caller, Dara the Dragon-Tamer, and their band of misfits are chosen by fate to restore the legacy of the ancient deities.</li><li>Middle: ๐Ÿง—โ€โ™‚๏ธ๐ŸŒฉ๏ธ The group embarks on a series of perilous adventures, unearthing long-lost relics and rediscovering the powers of the gods.</li><li>End: โš”๏ธ๐ŸŒ‘ They prevent the rise of a new dark power, restoring the gods' rightful place in the world and transforming it for the better.</li></ul> |
8
+ | The Time Weaver Chronicles โณ๐Ÿง™โ€โ™‚๏ธ๐Ÿ•ฐ๏ธ | <ul><li>Beginning: ๐Ÿ•ฐ๏ธ Tim the Time-Weaver, a sorcerer with the ability to travel through time, sets out on a mission to prevent a catastrophic event from occurring.</li><li>Middle: โŒ›๐ŸŒ€ As Tim unravels the mysteries of the past, present, and future, he encounters new friends, formidable enemies, and unexpected challenges.</li><li>End: ๐Ÿง™โ€โ™‚๏ธ๐Ÿ” Tim ultimately averts the disaster, learning valuable lessons about the nature of time and the importance of living in the moment.</li></ul> |
9
+ | The Enchanted Forest Trilogy ๐ŸŒฒ๐Ÿฆ„โœจ | <ul><li>Beginning: ๐ŸŒณ๐Ÿฆ‹ In the hidden magical kingdom of the Enchanted Forest, a brave young elf named Elara must gather her friends to save their home from an evil sorceress.</li><li>Middle: ๐Ÿ‚๐ŸŒˆ As the group faces trials and tribulations, they discover the true power of friendship and the strength within themselves.</li><li>End: โš”๏ธ๐Ÿ”ฎ Elara and her friends defeat the sorceress, restoring peace and harmony to the Enchanted Forest and its magical creatures.</li></ul> |
10
+ | The Cursed Kingdom ๐Ÿฐ๐Ÿ‘ป๐Ÿ”ฎ | <ul><li>Beginning: ๐ŸŒ‘๐ŸŒฒ In a once-prosperous realm now plagued by dark forces, a group of heroes led by the courageous knight Sir Rowan sets out to break the curse and restore the light.</li><li>Middle: ๐ŸŒฉ๏ธ๐Ÿ‘ป As the heroes face daunting challenges and supernatural enemies, they uncover the hidden history of their kingdom and the true nature of the curse.</li><li>End: ๐Ÿฐ๐Ÿ’ก The group defeats the source of the darkness, lifting the curse and bringing hope and prosperity back to the kingdom.</li></ul> |
11
+ """)
12
+
13
+ import streamlit as st
14
+ import random
15
+ import json
16
+ import graphviz as gv
17
+
18
+ stories = [
19
+ {
20
+ "title": "The Celestial Gatekeepers โ˜„๏ธ๐ŸŒŸ๐Ÿ›ก๏ธ",
21
+ "outline": [
22
+ "๐ŸŒŒ Stella, the starry-eyed guardian, and her celestial companions are tasked with protecting the universe from cosmic threats.",
23
+ "๐Ÿ˜‡๐Ÿ‘ฟ As the team battles otherworldly foes, they must also confront their own inner demons and navigate the complex relationships within their ranks.",
24
+ "โš”๏ธ๐ŸŒ‘ The Gatekeepers face a powerful and ancient force of darkness, ultimately triumphing and strengthening their bonds as a team."
25
+ ]
26
+ },
27
+ {
28
+ "title": "The Children of the Forgotten Gods โšก๐Ÿ‰๐Ÿบ",
29
+ "outline": [
30
+ "๐Ÿบ In a world where the old gods have been forgotten, Theo the Thunder-Caller, Dara the Dragon-Tamer, and their band of misfits are chosen by fate to restore the legacy of the ancient deities.",
31
+ "๐Ÿง—โ€โ™‚๏ธ๐ŸŒฉ๏ธ The group embarks on a series of perilous adventures, unearthing long-lost relics and rediscovering the powers of the gods.",
32
+ "โš”๏ธ๐ŸŒ‘ They prevent the rise of a new dark power, restoring the gods' rightful place in the world and transforming it for the better."
33
+ ]
34
+ },
35
+ {
36
+ "title": "The Time Weaver Chronicles โณ๐Ÿง™โ€โ™‚๏ธ๐Ÿ•ฐ๏ธ",
37
+ "outline": [
38
+ "๐Ÿ•ฐ๏ธ Tim the Time-Weaver, a sorcerer with the ability to travel through time, sets out on a mission to prevent a catastrophic event from occurring.",
39
+ "โŒ›๐ŸŒ€ As Tim unravels the mysteries of the past, present, and future, he encounters new friends, formidable enemies, and unexpected challenges.",
40
+ "๐Ÿง™โ€โ™‚๏ธ๐Ÿ” Tim ultimately averts the disaster, learning valuable lessons about the nature of time and the importance of living in the moment."
41
+ ]
42
+ },
43
+ {
44
+ "title": "The Enchanted Forest Trilogy ๐ŸŒฒ๐Ÿฆ„โœจ",
45
+ "outline": [
46
+ "๐ŸŒณ๐Ÿฆ‹ In the hidden magical kingdom of the Enchanted Forest, a brave young elf named Elara must gather her friends to save their home from an evil sorceress.",
47
+ "๐Ÿ‚๐ŸŒˆ As the group faces trials and tribulations, they discover the true power of friendship and the strength within themselves.",
48
+ "โš”๏ธ๐Ÿ”ฎ Elara and her friends defeat the sorceress, restoring peace and harmony to the Enchanted Forest and its magical creatures."
49
+ ]
50
+ },
51
+ {
52
+ "title": "The Cursed Kingdom ๐Ÿฐ๐Ÿ‘ป๐Ÿ”ฎ",
53
+ "outline": [
54
+ "๐ŸŒ‘๐ŸŒฒ In a once-prosperous realm now plagued by dark forces, a group of heroes led by the courageous knight Sir Rowan sets out to break the curse and restore the light.",
55
+ "๐ŸŒฉ๏ธ๐Ÿ‘ป As the heroes face daunting challenges and supernatural enemies, they uncover the hidden history of their kingdom and the true nature of the curse.",
56
+ "๐Ÿฐ๐Ÿ’ก The group defeats the source of the darkness, lifting the curse and bringing hope and prosperity back to the kingdom."
57
+ ]
58
+ }
59
+ ]
60
+
61
+ def generate_graph(story):
62
+ g = gv.Digraph()
63
+ for i, part in enumerate(story["outline"]):
64
+ emojis = "".join(c for c in part if c in emoji.UNICODE_EMOJI_ENGLISH)
65
+ g.node(str(i), label=emojis)
66
+
67
+ if i > 0:
68
+ g.edge(str(i - 1), str(i))
69
+
70
+ return g