This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SiliconValleyOfTheSouth | |
# Original Program by Wray at Tech Em Studios | |
# Put your commands here | |
# Keep the values lowercase | |
COMMAND1 = "what?" | |
# Your handling code goes in this function | |
def handle_command(command): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ANODE_ACTIONS = { | |
"Hold the door open for someone today.": "Hold the door open for someone today.", | |
"Give someone a compliment.": "Give someone a compliment.", | |
"Get your body moving. Do some form of exercise!": "Get your body moving. Whatever you are able to do just get moving! From jumping jacks to yard work. Whatever you decide, Exercising can help offset depression, anxiety, and stress.", | |
"Listen to or read a positive or uplifting message": "Listen or read a positive message, or has uplifting content. The variety of subject matter, the better.", | |
"Eat some veggies today!": "Eat a serving of at least two veggies today.", | |
"Thank a person that has helped you.": "Think about how a person has helped you in some way. This could either be a friend, family member, colleague, teacher, or even a pet. And go ahead and thank them. This can go a long way in making another feel good.", | |
"Take a cold shower!": "Take a cold shower. Yes. Cold. Studies show, taking a cold shower can increase oxygen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO | |
DEBUG = 1 | |
GPIO.setmode(GPIO.BCM) | |
GREEN_LED = 4 | |
RED_LED = 5 | |
BLUE_LED = 26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A simple program asking a user to guess the "computer's" favorite color. | |
The favorite color of the computer is set in a variable, favColor. | |
The computer checks the user's input to match the favColor variable. | |
If it is any color other than the computer's favorite color, the loop continues. | |
Otherwise, the loop is ended when the flag is set to False (or, the user enters the | |
exact string equal to the favColor variable. | |
This will be a given program that students in Game Design will execute. Once executed, they | |
will be prompted with a challenge to create their own program which models the concepts in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, pygame | |
pygame.init() | |
size = width, height = 600, 600 | |
speed = [1, 1] | |
red = 130, 202, 154 | |
screen = pygame.display.set_mode(size) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 2.7 | |
# Code Em Level 2 - Icebreaker | |
# a program to generate random numbers by using the random module | |
# a random number is picked, and the user must guess the number between 1 and 100. | |
import random | |
number = random.randint(1, 100) | |
print("I'm thinking of number between 1 and 100") | |
print("Try to guess the number with as few attempts as possible") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 2.7 | |
# CREATING AND USING A CLASS | |
# You can model model almost anything using classes. | |
# Let's start by defining classes from our first example. | |
class Things(): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 2.7 | |
# CREATING AND USING A CLASS | |
# You can model almost anything using classes. Let's start by writing a simple | |
# class, Computer, that represents a modern computer --not one computer in particular, but any modern computer. | |
# What do we know about most modern computers? | |
# They have a name and can store memory. | |
# and many computers can take input and display input. | |
# The two pieces of information (name and memory capacity) | |
# and the two behaviors (input and output) can go in the class Computer, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Let's get some input from the user. | |
name = raw_input('Please enter your name: ') | |
# How can we do something with the value that was entered? | |
# In other words, how can we display the user's name??? | |
# one way, is a print statement with some concatenation (or adding strings and variables nad other characters) | |
print("Hello " + name + "!") | |
#### | |
#### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 2.7 | |
# example code from Crash Course Python by Eric Matthes | |
# Recall for loops | |
# The for loop takes a collection of items and executes a block of code once | |
# for each item in the collection. | |
# PYTHON WHILE LOOPS | |
# In contrast, the while loop runs as longs as (or while) a certain condition is true |