awacke1 commited on
Commit
4415ee3
ยท
verified ยท
1 Parent(s): fe0ee72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -6
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 - JS Expert - Write a HTML5 JS 3D program that implements each word game feature in three codes or less per feature. With index.html and inline JS with calls to widely used JS libraries like Aframe.
478
- webquery = 'Write a web user interface to play a word game called ' + query + '.'
479
- webquery = webquery + 'Please study my Javascript preferences on word game features here: '
480
- webquery = webquery + WordGameJavascript
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 + 'Also use this code written in python and streamlit to serve as a template and inject the HTML5 and Javascript features into streamlit using components and st.markdown as well as we based standards so comment where it can be integrated with Javascript web app and Streamlit UI working together.'
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