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 collections import namedtuple | |
| class Point(namedtuple('_Point', ['x', 'y'])): | |
| def __add__(self, other): | |
| return Point(self.x + other.x, self.y + other.y) | |
| shopkeeper = Point(2, 1) | |
| rune = Point(2, 5) | |
| size = Point(5, 7) | |
| gold_weapon = Point(1, 3) |
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
| #!/bin/bash | |
| gen-keys() { | |
| for control in "$@"; do | |
| echo $enter "$control" $down | |
| done | |
| } | |
| # weird key names | |
| up=Up |
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
| #!/bin/env python2 | |
| import array | |
| import fcntl | |
| import argh | |
| LIRC_MODE_PULSE = 2 | |
| def ioc(dir, type, nr, size): |
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 collections | |
| import random | |
| from fractions import Fraction | |
| class Outcomes: | |
| """ | |
| Represents a set of possible outcomes along with the probability they'll occur. | |
| Supports the following operations: | |
| outcomes1 * outcomes2: |
OlderNewer