I hereby claim:
- I am matthewdeanmartin on github.
- I am matthewmartin (https://keybase.io/matthewmartin) on keybase.
- I have a public key whose fingerprint is B872 7483 FE04 D5DF 646F FE24 C9BF 8F64 F7C8 3FA8
To claim this, I am signing this object:
| # remove the input (dependency injection here) | |
| # prefer returns over prints (I'm violating that here) | |
| # for each ~5 lines of code, break into functions | |
| # start with good names | |
| # start adding assertions and then unit tests to clean up the bugs (also violated here) | |
| # until I do that last part, I'm not really sure if this really works. | |
| import random | |
| def games(input): |
| from module import fallback | |
| from module import send_email | |
| def email_report(): | |
| try: | |
| # mocks just fine, if I mock just one thing | |
| send_email() | |
| except: | |
| # hard to mock, tried many, many things. | |
| fallback() | |
| PROJECT := src | |
| tests: | |
| # run those tests | |
| pytest $(PROJECT) --doctest-modules | |
| lint: | |
| # pick ones that match target generator & syntax | |
| # can't figure out how to enable just doc related | |
| # pylint pydoc_fork --disable=all --enable=basic,spelling |
I hereby claim:
To claim this, I am signing this object:
| # Define the EvilEliza chat bot | |
| class EvilEliza: | |
| # Define the possible EvilEliza responses | |
| responses = [ | |
| "I don't think you're ready to face the truth.", | |
| "You're just making excuses for your own failure.", | |
| "Your problems are all in your head. You need to snap out of it.", | |
| "You're not really trying to get better, are you?", | |
| "Why do you bother talking to me if you don't want to change?", | |
| ] |
| # Set the initial values for the game | |
| player_score=0 | |
| computer_score=0 | |
| # Define the function for playing a round of the game | |
| play_round () { | |
| # Ask the player for their choice | |
| echo "Choose one: paper, scissors, rock" | |
| read player_choice |
| # Define a variable to hold the upper limit of the numbers to print | |
| variable "upper_limit" { | |
| default = 100 | |
| } | |
| # Define a local value to hold the current number | |
| locals { | |
| current_number = 1 | |
| } |
| # Import the pygame module | |
| import pygame | |
| # Initialize the game | |
| pygame.init() | |
| # Set the screen size and caption | |
| screen = pygame.display.set_mode((800, 600)) | |
| pygame.display.set_caption("Pac-Man") |
| def markdown_to_mediawiki(input_string: str) -> str: | |
| # Initialize the output string | |
| output_string = input_string | |
| # Convert bold and italic text | |
| output_string = output_string.replace('**', "'''") | |
| output_string = output_string.replace('__', "''") | |
| output_string = output_string.replace('*', "''") | |
| # Convert heading levels |
| # Define a function that represents the game | |
| def play_oregon_trail(): | |
| # Initialize the game variables | |
| distance_traveled = 0 | |
| supplies = 100 | |
| health = 100 | |
| weather = "sunny" | |
| # Print the game introduction | |
| print("Welcome to the Oregon Trail! You are a pioneer traveling west in search of a new life.\n") |