Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -433,6 +433,38 @@ def search_glossary(query): # ๐Run------------------------------------------
|
|
433 |
9. ๐พ File I/O: Reading from and writing to files, useful for storing game data like high scores or word lists.
|
434 |
10. ๐ค AI: Implementing artificial intelligence techniques to create computer-controlled opponents in word games."""
|
435 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
436 |
WordGameJavascript="""Generate 10 high-information words related to word game programming in Javascript, used in context with emojis:
|
437 |
1. ๐ Javascript: A versatile programming language commonly used for web-based games and interactivity.
|
438 |
2. ๐ท๏ธ HTML: The markup language used to structure the content of web pages, including game elements.
|
@@ -474,12 +506,12 @@ def search_glossary(query): # ๐Run------------------------------------------
|
|
474 |
|
475 |
# todo - add back python execution located elsewhere here in comment. acw 2/24/2022/6:20
|
476 |
|
477 |
-
# ๐Run 4 -
|
478 |
-
webquery = '
|
479 |
-
webquery = webquery + 'Please study my Javascript preferences on word game features here: '
|
480 |
-
webquery = webquery +
|
481 |
-
webquery = webquery + 'The objective of this exercise is to create a visually appealing UI so the user has fun interacting with these game features so each should use timers, randomness, word tables, and features found in word games in a dynamic html5 app with javascript which make it fun.'
|
482 |
-
webquery = webquery + '
|
483 |
webquery = webquery + coderesponse # feed forward expert output to next expert agent
|
484 |
webresponse = chat_with_model(webquery)
|
485 |
all = all + webquery + ' ' + webresponse
|
|
|
433 |
9. ๐พ File I/O: Reading from and writing to files, useful for storing game data like high scores or word lists.
|
434 |
10. ๐ค AI: Implementing artificial intelligence techniques to create computer-controlled opponents in word games."""
|
435 |
|
436 |
+
|
437 |
+
WordGamePython2="""1. ๐จ Streamlit: A Python library for building interactive web apps, perfect for creating word games.
|
438 |
+
Example: st.title("Welcome to the Word Guessing Game! ๐ฎ")
|
439 |
+
|
440 |
+
2. ๐๏ธ JSON: A lightweight data interchange format, useful for storing and loading game data.
|
441 |
+
Example: game_data = json.loads(st.secrets["game_data"])
|
442 |
+
|
443 |
+
3. ๐ฒ Random: A Python module for generating random numbers, handy for selecting random words or letters.
|
444 |
+
Example: random_word = random.choice(word_list)
|
445 |
+
|
446 |
+
4. ๐ Time: A Python module for handling time-related tasks, such as measuring game duration or implementing timers.
|
447 |
+
Example: start_time = time.time()
|
448 |
+
|
449 |
+
5. ๐ Regex: Short for Regular Expressions, a powerful tool for pattern matching and text manipulation.
|
450 |
+
Example: if re.match(r"^[a-zA-Z]+$", user_input):
|
451 |
+
|
452 |
+
6. ๐ Requests: A Python library for making HTTP requests, useful for fetching word lists or definitions from online APIs.
|
453 |
+
Example: response = requests.get("https://api.wordnik.com/v4/words.json/randomWord")
|
454 |
+
|
455 |
+
7. ๐ผ๏ธ PIL (Python Imaging Library): A library for opening, manipulating, and saving images, great for adding visual elements to your word game.
|
456 |
+
Example: image = Image.open("background.jpg")
|
457 |
+
|
458 |
+
8. ๐ URLLib: A Python module for handling URLs, useful for encoding and decoding special characters in word-related URLs.
|
459 |
+
Example: encoded_word = quote(user_input)
|
460 |
+
|
461 |
+
9. ๐พ IO (Input/Output): A Python module for handling input and output operations, such as reading from and writing to files or in-memory buffers.
|
462 |
+
Example: word_list = BytesIO(requests.get("https://example.com/words.txt").content)
|
463 |
+
|
464 |
+
10. ๐งฉ Collections: A Python module providing useful data structures, such as deque for efficient list manipulation.
|
465 |
+
Example: letter_queue = deque(random.sample(string.ascii_uppercase, 10))"""
|
466 |
+
|
467 |
+
|
468 |
WordGameJavascript="""Generate 10 high-information words related to word game programming in Javascript, used in context with emojis:
|
469 |
1. ๐ Javascript: A versatile programming language commonly used for web-based games and interactivity.
|
470 |
2. ๐ท๏ธ HTML: The markup language used to structure the content of web pages, including game elements.
|
|
|
506 |
|
507 |
# todo - add back python execution located elsewhere here in comment. acw 2/24/2022/6:20
|
508 |
|
509 |
+
# ๐Run 4 - Code Completion Expert -
|
510 |
+
webquery = 'Revise and expand on features in my game for ' + query + '. For each python function, improve the feature by adding 3 to 5 code lines each that implements the feature and UI in detail for streamlit so the user can play each feature.'
|
511 |
+
#webquery = webquery + 'Please study my Javascript preferences on word game features here: '
|
512 |
+
webquery = webquery + WordGamePython2
|
513 |
+
#webquery = webquery + 'The objective of this exercise is to create a visually appealing UI so the user has fun interacting with these game features so each should use timers, randomness, word tables, and features found in word games in a dynamic html5 app with javascript which make it fun.'
|
514 |
+
webquery = webquery + 'use this code written in python and streamlit, expanding language features in python and streamlit functions along with popular third party python libraries.'
|
515 |
webquery = webquery + coderesponse # feed forward expert output to next expert agent
|
516 |
webresponse = chat_with_model(webquery)
|
517 |
all = all + webquery + ' ' + webresponse
|