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 webapp2 | |
import re | |
import os | |
import jinja2 | |
import re | |
import hashlib | |
import hmac | |
import random | |
import string | |
from google.appengine.ext import db |
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
from graphics import * | |
class Wheel(): | |
def __init__(self, center, wheel_radius, tire_radius): | |
self.tire_circle = Circle(center, tire_radius) | |
self.wheel_circle = Circle(center, wheel_radius) | |
def draw(self, win): | |
self.tire_circle.draw(win) |
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
# graphics.py | |
##"""Simple object oriented graphics library | |
## | |
##The library is designed to make it very easy for novice programmers to | |
##experiment with computer graphics in an object oriented fashion. It is | |
##written by John Zelle for use with the book "Python Programming: An | |
##Introduction to Computer Science" (Franklin, Beedle & Associates). | |
## | |
##LICENSE: This is open-source software released under the terms of the | |
##GPL (http://www.gnu.org/licenses/gpl.html). |
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
class OldMaidGame(CardGame): | |
def play(self, names): | |
self.deck.removeCard(Card(0,12)) | |
self.hands = [] | |
for name in names: | |
self.hands.append(OldMaidHand(name)) | |
self.deck.deal(self.hands) | |
print "----------- Cards have been dealt" |
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
def print_hangman_image(mistakes = 6): | |
"""Prints out a gallows image for hangman. The image printed depends on | |
the number of mistakes (0-6).""" | |
if mistakes <= 0: | |
print''' ____________________ | |
| .__________________| | |
| | / / | |
| |/ / | |
| | / |