Created
July 27, 2018 03:17
-
-
Save joshdurbin/af489b3f905e5dadce3b2182e9136204 to your computer and use it in GitHub Desktop.
shit
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 __future__ import division | |
import sheep | |
from color import RGB | |
A = [1, 3, 4, 7, 9, 12, 16, 18, 19, 21, 22, 24, 27, 30, 33, 35, 37, 39, 42] | |
B = [2, 5, 6, 8, 11, 13, 14, 15, 17, 20, 23, 25, 26, 28, 29, 31, 32, 34, 36, 40, 41, 43] | |
class Josh(object): | |
def __init__(self, sheep_sides): | |
self.name = "Durbin" | |
self.cells = sheep_sides.both | |
self.hertz = 30 | |
self.speed = 1 / self.hertz | |
print "Running at %d Hertz (%f delay)" % (self.hertz, self.speed) | |
self.color1 = RGB(255,148,0) # orange | |
self.color2 = RGB(148,0,255) # purple | |
def next_frame(self): | |
while True: | |
self.cells.set_cells(A, self.color1) | |
self.cells.set_cells(B, self.color2) | |
yield self.speed | |
self.cells.set_cells(B, self.color1) | |
self.cells.set_cells(A, self.color2) | |
yield self.speed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment