Skip to content

Instantly share code, notes, and snippets.

View daniel-schroeder-dev's full-sized avatar

Daniel Schroeder daniel-schroeder-dev

  • PFES/Entergy/CodeWizardsHQ
  • New Orleans, LA
View GitHub Profile
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Created July 24, 2022 22:56
E22 Lesson 5 Idea - Pokemon Catcher
from random import randint, choice
def throw_poke_ball():
return randint(1, 5)
available_pokemon = [
"Pikachu",
"Eevee",
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Created July 19, 2022 22:41
Jocelyn Math Quiz
from random import randint
#FUNCTIONS
def display_banner():
welcome = """
Welcome to the Math Quiz!
You'll start with three lives.
Each round, you'll be asked to solve a math problem.
def add_ghost(x, y, animate_vertical):
ghost = add_image("ghost.png", 50)
position_element(ghost, x, y)
# If we want to animate veritcal
animate_down(ghost, 100, 2, True)
# Otherwise
animate_right(ghost, 100, 2, True)
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Last active July 19, 2022 22:46
Roman Slots
"""
################ HINTS #####################################
Create an app that models a slot machine.
- Our user needs tokens to play the slot machine, so create a variable to hold
these tokens and store as many as you wish at the start of the app.
- Track the number of rounds the user plays in a variable as well.
- Create a loop that runs while the user has tokens.
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Last active July 19, 2022 21:46
Brit Guess The Number
from random import randint
number_streak = 0
while True:
user_choice = int(input("Guess a number between 1 and 100: "))
random_number = randint(1,100)
if user_choice == random_number:
number_streak += 1
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Created July 18, 2022 22:18
Twenty-One Roman
"""
################ HINTS #####################################
Create an app that simulates a simple game of twenty-one.
- You'll need two players. One should be the dealer, the other should be the
player (user).
- You'll need to generate random numbers, so import the correct function
from the correct module.
- Assume each round a player can draw a card from 1-10, and simulate two
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Last active July 18, 2022 22:27
Twenty-One Kameron
"""
################ HINTS #####################################
Create an app that simulates a simple game of twenty-one.
- You'll need two players. One should be the dealer, the other should be the
player (user).
- You'll need to generate random numbers, so import the correct function
from the correct module.
- Assume each round a player can draw a card from 1-10, and simulate two
span {
color: white;
display: block;
}
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Last active July 2, 2022 20:06
P12 - Lesson 12 - Exercise 4 - Step 2
...
def save_search_results(search_term, artworks, books, articles, username):
...
search_results[username][search_term] = {
...
}
# Open the search-results.json file in write mode
with open(___, mode=___) as json_file:
# Save the search_results to the search-results.json file
@daniel-schroeder-dev
daniel-schroeder-dev / main.py
Created July 2, 2022 19:56
P12 - Lesson 12 - Exercise 3 Step 2
def save_search_results(search_term, artworks, books, articles, username):
...
if ___.get(___) is None:
...
# Add the search_term key to the username dict on the
# the search_results dict
search_results[username][search_term] = {
"artworks": ___,