This file contains hidden or 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
# I removed the big tag up top for now. Feel free to add it if you like | |
# Also removed the '#!/bin/python' bit as this script will never be run | |
# The namedtuple will be used for handling locations | |
from collections import namedtuple | |
# I moved the grid to a separate file because it cluttered up this one. | |
# Might as well keep the ugly contained, ya know? | |
from grid import grid |
This file contains hidden or 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
"""The grid representing the Sleuth game board | |
Each cell in the two dimensional list represents a tile in the game. There are | |
three types of tiles that exist: inaccessable, normal, and door tiles. Tiles | |
are traversed only in the four cardinal directions (N, S, E, W). As such, | |
there exist two types of doors, North/South and East/West doors. The numbers | |
representing these tiles are defined as follows: | |
0 : Inaccessable Tile | |
1 : Normal Tile |
This file contains hidden or 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 increment_result(func): | |
def wrapper(*args, **kwargs): | |
return func(*args, **kwargs) + 1 | |
return wrapper | |
@increment_result | |
def square_it(number): | |
return number * number |
This file contains hidden or 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 math import sqrt | |
def count(start, step): | |
"""Happens to be included in the standard library""" | |
number = int(start) | |
while True: | |
yield number | |
start += number |
This file contains hidden or 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 random | |
import json | |
CONTENT_PATH = './content.json' | |
DEBUG = True | |
#raw_input = input # Hack for Python 3 | |
class Scene(object): |
This file contains hidden or 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
{ | |
"room_one": [ | |
"You are in a deep, dark forest. You have wandered off the trail, and have lost your way.", | |
"A column of chimney smoke appears over the treetops in the failing light. What do you do?" | |
], | |
"cottage": [ | |
"You enter the cottage. A table as tall as you stand in the center of the giant room,", | |
"and whole timbers burn in a cavernous fireplace. A cow on a spit roasts in the flames.", | |
"The room fills with the smell of perfectly done roast beef. Thundering footsteps", | |
"come closer and closer until a giant appears in the doorway be" |
This file contains hidden or 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 datetime | |
import itertools | |
import os | |
import pathlib | |
import smtplib | |
FIFTEEN_MINUTES = datetime.timedelta(minutes=15) | |
OlderNewer