Spaces:
Sleeping
Sleeping
File size: 19,694 Bytes
f5c1090 7f9277f 5609672 0285ca1 5609672 f5c1090 5609672 f5c1090 5609672 f5c1090 5609672 f5c1090 5609672 f5c1090 5609672 f5c1090 5609672 f5c1090 5609672 f5c1090 5609672 f5c1090 ac73dbc 0285ca1 daedcc7 0285ca1 3720bad 0285ca1 f5c1090 b304107 bb55363 b304107 c76ba6b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 |
import streamlit as st
st.video("Baby Gecko Learns Poetry.mp4")
markdown=("""
Teaching a baby gecko poetry can be a fun and rewarding experience.
You can start by reading poems out loud to the baby gecko,
choosing simple and rhythmic poems that they can easily follow along with.
You can also try reciting short poems to them regularly,
which can help them become familiar with the sounds and rhythms of poetry.
Additionally, you can create a comfortable and peaceful environment for the
baby gecko to listen to poetry. Consider playing soft music or creating a
calming atmosphere to enhance their learning experience.
Remember to be patient and consistent in your efforts to teach the
baby gecko poetry. With time and practice, they may start to show an interest
in poetry and even begin to mimic the sounds and rhythms they hear.
Enjoy this special bonding experience with your baby gecko as you explore
the world of poetry together!
# Baby Gecko Learns Poetry Word Game
## Introduction
In this whimsical and educational word game, players will embark on a delightful journey with Baby Gecko as they learn poetry through fun challenges and wordplay. As an expert storyteller and word game creator, my inner dialog is buzzing with creativity to bring this game to life!
## Game Features
1. π Rules
Description: The official guidelines that govern the gameplay and objectives of the word game.
2. β° Time Limit
Description: A constraint on the duration allowed for players to complete their turns or the entire game.
3. π² Dice
Description: Used in some word games to randomly determine letter selection or point values.
4. π Dictionary
Description: A reference book used to validate the legitimacy of words formed by players.
5. π Alphabet
Description: The set of letters used to construct words in the game, often with varying point values.
6. π Turn
Description: The opportunity for each player to form words or perform actions as per the game rules.
7. π§© Board
Description: The playing surface on which letter tiles are placed to form words in certain word games.
8. π Challenge
Description: An action that allows players to contest the validity of words formed by their opponents.
9. π° Score
Description: Points earned by players for forming valid words, often based on letter values and word length.
10. β Pass
Description: An option for players to skip their turn if unable to form a word, sometimes with penalties.
## Storyline
Once upon a time in the lush jungle, Baby Gecko found a mysterious book of poetry. Eager to learn, Baby Gecko decided to embark on a poetic adventure with friends. Each friend represented a different aspect of language - Grammar Gorilla, Vocabulary Vulture, and Syntax Sloth.
## Gameplay
Players will take turns rolling the poetic dice, which will determine the letters they can use to form words. The board will be a magical forest where players place their word tiles to create beautiful poems. Each turn, players can challenge each other's words for extra fun!
## Objective
The objective of the game is to help Baby Gecko and friends learn poetry by forming words, creating rhymes, and exploring the wonders of language. Players will earn points based on the complexity and creativity of their poems.
# Conclusion
With the combination of storytelling, wordplay, and poetry, Baby Gecko Learns Poetry is a delightful game that will not only entertain but also enhance players' language skills. Join Baby Gecko and friends on this enchanting journey through the world of words!*
""")
st.markdown(markdown)
# HTML5 based Speech Synthesis (Text to Speech in Browser)
@st.cache_resource
def SpeechSynthesis(result):
documentHTML5='''
<!DOCTYPE html>
<html>
<head>
<title>Read It Aloud</title>
<script type="text/javascript">
function readAloud() {
const text = document.getElementById("textArea").value;
const speech = new SpeechSynthesisUtterance(text);
window.speechSynthesis.speak(speech);
}
</script>
</head>
<body>
<h1>π Read It Aloud</h1>
<textarea id="textArea" rows="10" cols="80">
'''
documentHTML5 = documentHTML5 + result
documentHTML5 = documentHTML5 + '''
</textarea>
<br>
<button onclick="readAloud()">π Read Aloud</button>
</body>
</html>
'''
st.components.v1.html(documentHTML5, width=1280, height=300)
SpeechSynthesis(markdown)
import streamlit as st
import random
# Feature 1: π Python
def python_feature():
st.header("π Python Feature")
st.write("Python is a high-level programming language known for its simplicity and readability.")
# Feature 2: π String
def string_feature():
st.header("π String Feature")
st.write("String is a data type used to represent text, essential for handling words in a word game.")
# Feature 3: π² Random
def random_feature():
st.header("π² Random Feature")
random_number = random.randint(1, 6)
st.write(f"Randomly generated number: {random_number}")
# Create UI for each feature
st.title("Baby Gecko Learns Poetry Word Game")
python_feature()
string_feature()
random_feature()
# Try harder! (calling claude 3 to help w next part..)
import streamlit as st
import random
import string
st.title("Baby Gecko Learns Poetry Word Game")
# Feature 1: π Rules
st.header("π Rules")
st.write("Form words using the given letters within the time limit.")
st.write("Earn points based on the length and complexity of the words.")
st.write("Challenge opponents' words to gain extra points.")
# Feature 2: β° Time Limit
time_limit = 60
st.header(f"β° Time Limit: {time_limit} seconds")
# Feature 3: π² Dice
dice_faces = ['A', 'B', 'C', 'D', 'E', 'F']
st.header("π² Dice")
if st.button("Roll Dice"):
rolled_letter = random.choice(dice_faces)
st.write(f"Rolled Letter: {rolled_letter}")
# Feature 4: π Dictionary
dictionary = ['apple', 'banana', 'cherry', 'date', 'elderberry', 'fig']
st.header("π Dictionary")
st.write(f"Valid Words: {', '.join(dictionary)}")
# Feature 5: π Alphabet
alphabet = list(string.ascii_uppercase)
st.header("π Alphabet")
st.write(f"Available Letters: {', '.join(alphabet)}")
# Feature 6: π Turn
current_player = "Player 1"
st.header(f"π Current Turn: {current_player}")
# Feature 7: π§© Board
board = [['_' for _ in range(5)] for _ in range(5)]
st.header("π§© Board")
for row in board:
st.write(' '.join(row))
# Feature 8: π Challenge
def challenge_word():
challenged_word = st.text_input("Enter the word to challenge:")
if challenged_word in dictionary:
st.write(f"{challenged_word} is a valid word!")
else:
st.write(f"{challenged_word} is not a valid word!")
st.header("π Challenge")
if st.button("Challenge Word"):
challenge_word()
# Feature 9: π° Score
player_scores = {"Player 1": 0, "Player 2": 0}
st.header("π° Scores")
for player, score in player_scores.items():
st.write(f"{player}: {score} points")
# Feature 10: β Pass
def pass_turn():
global current_player
if current_player == "Player 1":
current_player = "Player 2"
else:
current_player = "Player 1"
st.write(f"Turn passed to {current_player}")
st.header("β Pass")
if st.button("Pass Turn"):
pass_turn()
# Feature 11: π Rhyming Words
rhyming_words = [
("cat", "hat"), ("dog", "log"), ("play", "day"), ("night", "light"),
("moon", "june"), ("star", "car"), ("sun", "fun"), ("tree", "free"),
("sky", "high"), ("rain", "pain"), ("cloud", "proud"), ("wind", "kind"),
("bird", "word"), ("flower", "power"), ("grass", "class"), ("leaf", "belief"),
("rock", "clock"), ("water", "daughter"), ("fire", "desire"), ("earth", "birth")
]
st.header("π Top 20 Rhyming Word Pairs")
for pair in rhyming_words[:20]:
st.write(f"{pair[0]} - {pair[1]}")
import streamlit as st
import random
import string
st.title("Baby Gecko Learns Poetry Word Game")
# Feature 12: π Procedural Rhymes
st.header("π Procedural Rhymes")
rhyming_sounds = {
"ay": ["day", "play", "say", "way"],
"ee": ["see", "tree", "free", "me"],
"igh": ["high", "sky", "fly", "why"],
"ow": ["now", "cow", "how", "bow"],
"oo": ["too", "zoo", "blue", "true"],
"uck": ["luck", "duck", "truck", "stuck"],
"at": ["cat", "hat", "rat", "bat"],
"op": ["top", "pop", "hop", "stop"],
"ug": ["hug", "bug", "rug", "mug"],
"ink": ["think", "pink", "sink", "link"],
"ing": ["sing", "ring", "king", "wing"],
"ell": ["tell", "bell", "well", "sell"],
"ake": ["make", "cake", "lake", "shake"],
"ore": ["more", "store", "score", "bore"],
"ight": ["night", "light", "right", "sight"]
}
top_5_sounds = ["ay", "ee", "igh", "ow", "oo"]
st.subheader("Top 5 Rhyming Sound Endings")
for sound in top_5_sounds:
examples = ", ".join(rhyming_sounds[sound][:2])
st.write(f"Sound: {sound} | Examples: {examples}")
st.subheader("Procedural Rhyme Generator")
selected_sound = st.selectbox("Select a rhyming sound ending:", list(rhyming_sounds.keys()))
num_lines = st.number_input("Enter the number of lines for the rhyme:", min_value=1, max_value=10, value=4, step=1)
if st.button("Generate Rhyme"):
rhyme_lines = []
for _ in range(num_lines):
rhyme_word = random.choice(rhyming_sounds[selected_sound])
rhyme_lines.append(rhyme_word)
st.subheader("Generated Rhyme")
st.write("\n".join(rhyme_lines))
st.subheader("Reference Rhyming Word Sounds")
for sound, words in rhyming_sounds.items():
examples = ", ".join(words[:2])
st.write(f"Sound: {sound} | Examples: {examples}")
import streamlit as st
import random
import string
st.title("Baby Gecko Learns Poetry Word Game")
# Feature 12: π Procedural Rhymes
st.header("π Procedural Rhymes")
rhyming_sounds = {
"ay": ["day", "play", "say", "way"],
"ee": ["see", "tree", "free", "me"],
"igh": ["high", "sky", "fly", "why"],
"ow": ["now", "cow", "how", "bow"],
"oo": ["too", "zoo", "blue", "true"],
"uck": ["luck", "duck", "truck", "stuck"],
"at": ["cat", "hat", "rat", "bat"],
"op": ["top", "pop", "hop", "stop"],
"ug": ["hug", "bug", "rug", "mug"],
"ink": ["think", "pink", "sink", "link"],
"ing": ["sing", "ring", "king", "wing"],
"ell": ["tell", "bell", "well", "sell"],
"ake": ["make", "cake", "lake", "shake"],
"ore": ["more", "store", "score", "bore"],
"ight": ["night", "light", "right", "sight"]
}
top_5_sounds = ["ay", "ee", "igh", "ow", "oo"]
st.subheader("Top 5 Rhyming Sound Endings")
for sound in top_5_sounds:
examples = ", ".join(rhyming_sounds[sound][:2])
st.write(f"Sound: {sound} | Examples: {examples}")
st.subheader("Procedural Rhyme Generator")
selected_sound = st.selectbox(key='rhymegenerator', "Select a rhyming sound ending:", list(rhyming_sounds.keys()))
num_lines = st.number_input("Enter the number of lines for the rhyme:", min_value=1, max_value=10, value=4, step=1)
if st.button("Generate Rhyme"):
rhyme_lines = []
for _ in range(num_lines):
rhyme_word = random.choice(rhyming_sounds[selected_sound])
rhyme_lines.append(rhyme_word)
st.subheader("Generated Rhyme")
st.write("\n".join(rhyme_lines))
st.subheader("Reference Rhyming Word Sounds")
for sound, words in rhyming_sounds.items():
examples = ", ".join(words[:2])
st.write(f"Sound: {sound} | Examples: {examples}")
# Feature 13: π Sentence Structures
st.header("π Sentence Structures")
sentence_structures = [
"The [adjective] [noun] [verb] [adverb].",
"[Noun] [verb] [preposition] the [adjective] [noun].",
"[Adverb], the [noun] [verb] [preposition] the [noun].",
"In the [noun], [noun] [verb] [adverb]."
]
st.subheader("Example Sentence Structures")
for structure in sentence_structures:
st.write(structure)
st.subheader("Procedural Poetry Generator")
selected_structure = st.selectbox("Select a sentence structure:", sentence_structures)
if st.button("Generate Poetry"):
poetry_lines = []
for _ in range(4):
line = selected_structure
line = line.replace("[adjective]", random.choice(["happy", "shiny", "graceful", "gentle"]))
line = line.replace("[noun]", random.choice(["gecko", "butterfly", "rainbow", "breeze"]))
line = line.replace("[verb]", random.choice(["dances", "sings", "glides", "whispers"]))
line = line.replace("[adverb]", random.choice(["joyfully", "softly", "elegantly", "quietly"]))
line = line.replace("[preposition]", random.choice(["on", "under", "above", "through"]))
poetry_lines.append(line)
st.subheader("Generated Poetry")
st.write("\n".join(poetry_lines))
# Feature 14: π Rhyming Word Lists for Graphic Novels
st.header("π Rhyming Word Lists for Graphic Novels")
graphic_novel_rhymes = {
"Adventure": ["quest", "best", "test", "west"],
"Mystery": ["clue", "true", "new", "who"],
"Fantasy": ["dream", "gleam", "scheme", "supreme"],
"Science Fiction": ["space", "race", "place", "chase"],
"Romance": ["heart", "start", "art", "part"]
}
st.subheader("Rhyming Word Lists")
for genre, words in graphic_novel_rhymes.items():
st.write(f"{genre}: {', '.join(words)}")
import streamlit as st
import random
import string
st.title("Baby Gecko Learns Poetry Word Game")
# ... (previous code remains the same) ...
# Feature 15: π Story Generator
st.header("π Story Generator")
story_parts = {
"beginning": [
"In the realm of [noun], where [adjective] [noun_plural] roam, a [adjective] [noun] embarks on an epic journey.",
"Amidst the [adjective] [noun], a [noun] of unparalleled [noun] emerges, seeking to [verb] the world.",
"In a world fraught with [noun], a [adjective] [noun] arises, determined to [verb] the forces of [noun]."
],
"middle": [
"Endowed with [adjective] [noun], the [noun] [verb_past] through the [adjective] [noun], encountering [noun_plural] and [noun_plural].",
"With [noun] as their guide, the [noun] [verb_past] the [adjective] [noun], unraveling the secrets of [noun].",
"Confronted by the [adjective] [noun], the [noun] must [verb] their [noun] and [verb] the [adjective] [noun]."
],
"end": [
"In a climactic battle of [noun] and [noun], the [noun] [verb_past] the [adjective] [noun], emerging [adjective] and [adjective].",
"With the power of [noun] and [noun], the [noun] [verb_past] the [adjective] [noun], ushering in an era of [noun] and [noun].",
"Forever changed by their [adjective] journey, the [noun] [verb_past] home, their [noun] forever etched in the annals of [noun]."
]
}
vocabulary = {
"noun": ["quintessence", "paradigm", "phenomenon", "cognizance", "providence", "iniquity", "juxtaposition", "obfuscation", "rescission", "volition"],
"noun_plural": ["axioms", "dichotomies", "ephemera", "hermeneutics", "ontologies", "paradoxes", "semiotics", "tautologies", "vicissitudes", "zeitgeists"],
"adjective": ["abstruse", "Byzantine", "chimerical", "draconian", "ephemeral", "inexorable", "labyrinthine", "mercurial", "quixotic", "turgid"],
"verb": ["amalgamate", "bifurcate", "coalesce", "deconstruct", "extrapolate", "juxtapose", "metamorphose", "obfuscate", "reify", "transmogrify"],
"verb_past": ["amalgamated", "bifurcated", "coalesced", "deconstructed", "extrapolated", "juxtaposed", "metamorphosed", "obfuscated", "reified", "transmogrified"]
}
story_structure = ["beginning", "middle", "end"]
if st.button("Generate Story"):
story_paragraphs = []
for part in story_structure:
paragraph = []
for _ in range(3):
sentence = random.choice(story_parts[part])
for word_type in ["noun", "noun_plural", "adjective", "verb", "verb_past"]:
sentence = sentence.replace(f"[{word_type}]", random.choice(vocabulary[word_type]))
paragraph.append(sentence)
story_paragraphs.append(" ".join(paragraph))
st.subheader("Generated Story")
st.write("\n\n".join(story_paragraphs))
import streamlit as st
import random
import string
st.title("Baby Gecko's Continual Story Generator")
# Story Parts
story_parts = {
"beginning": [
"In the realm of [noun], where [idiom], a [adjective] [noun] embarks on an epic journey.",
"Amidst the [adjective] [noun], a [noun] of unparalleled [noun] emerges, seeking to [rhyme].",
"In a world fraught with [noun], a [adjective] [noun] arises, determined to [idiom]."
],
"middle": [
"Endowed with [adjective] [noun], the [noun] [verb_past] through the [adjective] [noun], [rhyme].",
"With [noun] as their guide, the [noun] [verb_past] the [adjective] [noun], unraveling the secrets of [noun].",
"Confronted by the [adjective] [noun], the [noun] must [idiom] and [rhyme]."
],
"end": [
"In a climactic battle of [noun] and [noun], the [noun] [verb_past] the [adjective] [noun], emerging [adjective] and [adjective].",
"With the power of [noun] and [noun], the [noun] [verb_past] the [adjective] [noun], [rhyme].",
"Forever changed by their [adjective] journey, the [noun] [verb_past] home, their [noun] forever etched in the annals of [noun]."
]
}
# Vocabulary
vocabulary = {
"noun": ["quintessence", "paradigm", "phenomenon", "cognizance", "providence", "iniquity", "juxtaposition", "obfuscation", "rescission", "volition"],
"adjective": ["abstruse", "Byzantine", "chimerical", "draconian", "ephemeral", "inexorable", "labyrinthine", "mercurial", "quixotic", "turgid"],
"verb_past": ["amalgamated", "bifurcated", "coalesced", "deconstructed", "extrapolated", "juxtaposed", "metamorphosed", "obfuscated", "reified", "transmogrified"],
"idiom": ["the cat's out of the bag", "a penny for your thoughts", "the elephant in the room", "a leopard can't change its spots", "the writing is on the wall", "a blessing in disguise", "a fish out of water", "a wild goose chase", "a square peg in a round hole", "a needle in a haystack"]
}
# Rhyme Generation (L-System Grammar)
def generate_rhyme(axiom, rules, iterations):
rhyme = axiom
for _ in range(iterations):
new_rhyme = ""
for char in rhyme:
new_rhyme += rules.get(char, char)
rhyme = new_rhyme
return rhyme
rhyme_axioms = ["A", "B", "C", "D", "E"]
rhyme_rules = {
"A": "[adjective] [noun]",
"B": "[verb_past] with [noun]",
"C": "in the [adjective] [noun]",
"D": "where [noun] [verb_past]",
"E": "and [adjective] [noun] [verb_past]"
}
# Story Generation
def generate_story():
story_paragraphs = []
for part in story_parts:
paragraph = []
for sentence_template in story_parts[part]:
sentence = sentence_template
for word_type in vocabulary:
if f"[{word_type}]" in sentence:
word = random.choice(vocabulary[word_type])
sentence = sentence.replace(f"[{word_type}]", word, 1)
if "[rhyme]" in sentence:
axiom = random.choice(rhyme_axioms)
rhyme = generate_rhyme(axiom, rhyme_rules, random.randint(1, 3))
sentence = sentence.replace("[rhyme]", rhyme, 1)
paragraph.append(sentence)
story_paragraphs.append(" ".join(paragraph))
return "\n\n".join(story_paragraphs)
# Streamlit App
if st.button("Generate Story"):
story = generate_story()
st.subheader("Generated Story")
st.write(story)
|