Instantly share code, notes, and snippets.

# joejoetechem

• Sort options
Created Dec 7, 2016
 # Choose your own adventure game # WIZARD MOUNTAIN # a text-based choose your own adventure game # This adventure is like an upside down tree with branches # this program is full of blocks of code, known as branches, or code branches # Make sure to visit every branch to make sure all of the code works def parachute_fail():
Created Dec 8, 2016
Joe.py.py
View Joe.py.py
 import random number = random.randint(1, 100) print number GameRunning = True while True: guess = int(raw_input("Guess a number between 1-100: ")) if guess == number: GameRunning = True print("You guessed correctly!") elif guess > number:
Created Dec 8, 2016
random_number_use_binary_search_method.py
View random_number_use_binary_search_method.py
 import random number = random.randint(1, 100) print number GameRunning = True while True: guess = int(raw_input("Guess a number between 1-100: ")) if guess == number: GameRunning = True print("You guessed correctly!") elif guess > number:
Created Dec 13, 2016
a simple gist to show how you can use a for loop and create a variable to use that variable
View for_loop_variable.py
 # A simple program to demonstrate using a for loop # To print hello world! five times in Python, you could type # print('hello world!') five times, each on its own line # Or, you could use a 'for loop' to have the same result with less typing: for x in range (0, 5): print('hello world!') # The range function can create a list of numbers ranging from a starting number # to the number just before the ending number.
Last active Jan 2, 2017
basic snake game using pygame, boundary event now working
View snake_pygame.py
 # BASIC SNAKE GAME # python 2.7 import pygame import time import random pygame.init() black = (0, 0, 0) white = (255, 255, 255)
Created Jan 10, 2017
random_number_start.py
View random_number_start.py
 import random # importing the random module number = random.randint(1, 100) # were are creating a variable to equal an array (or range) of numbers for the computer to choose from GameRunning = True while True: # make a loop guess = # don't forget your indents
Created Jan 23, 2017
calculator program using turtle as the output
View calculator_turtle.py
 import turtle t = turtle.Turtle() print("Give me a number") number1 = raw_input() print("Give me another number") number2 = raw_input() number1 = int(number1)
Last active Jan 25, 2017
snake game pygame
View snake_gist.py
 # BASIC SNAKE GAME import pygame import time import random pygame.init() black = (0, 0, 0) white = (255, 255, 255) red = (255, 0, 0)
Created Jan 27, 2017
random_number_guess
View random_number_guess.py
 import random number = random.randint(1, 100) # Here's the range of numbers the computer randomly chooses from print number # this line is just so you can test/see the numbers the computer chooses from # You likely want to comment this out once your whole program is running! # GameRunning variable here # Start your while loop here, Watch your indents below this loop! guess = int(raw_input("Guess a number between 1-100: ")) # letting Python know this is an integer if guess == number: # starting your condition statements
Last active Feb 10, 2017
showing an empty python dictionary
View empty_dictionary.py
 # Python 2.7 # By Joe # Below is a basic review of dictionaries in Python # starting with an empty dictionary, then adding information to it # Example: # MAKE AN EMPTY DICTIONARY john = {} # ADDING KEY-VALUE PAIRS TO THE DICTIONARY
You can’t perform that action at this time.