Skip to content

Instantly share code, notes, and snippets.

View joetechem's full-sized avatar
💭
Focusing on Cloud Arch responsibilities

joe joetechem

💭
Focusing on Cloud Arch responsibilities
View GitHub Profile
@joetechem
joetechem / random_number_guess.py
Created January 27, 2017 18:55
random_number_guess
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
@joetechem
joetechem / snake_gist.py
Last active January 25, 2017 23:15
snake game pygame
# BASIC SNAKE GAME
import pygame
import time
import random
pygame.init()
black = (0, 0, 0)
white = (255, 255, 255)
red = (255, 0, 0)
@joetechem
joetechem / calculator_turtle.py
Created January 23, 2017 22:32
calculator program using turtle as the output
import turtle
t = turtle.Turtle()
print("Give me a number")
number1 = raw_input()
print("Give me another number")
number2 = raw_input()
number1 = int(number1)
@joetechem
joetechem / random_number_start.py
Created January 10, 2017 16:15
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
@joetechem
joetechem / snake_pygame.py
Last active January 2, 2017 21:24
basic snake game using pygame, boundary event now working
# BASIC SNAKE GAME
# python 2.7
import pygame
import time
import random
pygame.init()
black = (0, 0, 0)
white = (255, 255, 255)
@joetechem
joetechem / for_loop_variable.py
Created December 13, 2016 19:42
a simple gist to show how you can use a for loop and create a variable to use that variable
# 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.
@joetechem
joetechem / random_number_use_binary_search_method.py
Created December 8, 2016 18:19
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:
@joetechem
joetechem / Joe.py.py
Created December 8, 2016 18:18
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:
@joetechem
joetechem / text_adventure.py
Created December 7, 2016 15:29
text_adventure.py
# 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():
@joetechem
joetechem / techem
Last active November 29, 2016 01:00
script to run for chbooks
#! /usr/local/bin/bash
apt-get --assume-yes install matplotlib
apt-get --assume-yes install idle
apt-get --assume-yes install git
apt-get --assume-yes install python-setuptools
apt-get --assume-yes install python-dev
apt-get --assume-yes install build-essential
easy_install pip
apt-get --assume-yes install git-cola