git @ Cat's Eye Technologies Jolverine / 56ff362
PEP-8 tidiness. Chris Pressey 1 year, 1 month ago
1 changed file(s) with 12 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
5252 def load_file(self, filename):
5353 self.load_string(open(filename, 'r').read())
5454
55 ### helpers ###
55 # ### helpers ### #
5656
5757 def limit(self, x):
5858 if x == 2:
6161 return 1
6262 return x
6363
64 ### instructions ###
64 # ### instructions ### #
6565
6666 def left(self):
6767 self.head -= 1
105105 else:
106106 raise ValueError("Illegal binary output value '%d'" % val)
107107
108 ### execution ###
108 # ### execution ### #
109109
110110 def cycle(self):
111111 self.index += 1
136136 self.x += self.dx
137137 self.y += self.dy
138138 self.dump()
139 if (self.x < 0 or self.y < 0 or
140 self.x > self.maxx or self.y > self.maxy):
139 if (
140 self.x < 0 or self.y < 0 or
141 self.x > self.maxx or self.y > self.maxy
142 ):
141143 break
142144 else:
143145 table = {
161163 self.x += self.dx
162164 self.y += self.dy
163165 self.dump()
164 if (self.x < 0 or self.y < 0 or
165 self.x > self.maxx or self.y > self.maxy):
166 if (
167 self.x < 0 or self.y < 0 or
168 self.x > self.maxx or self.y > self.maxy
169 ):
166170 break
167171
168 ### debugging ###
172 # ### debugging ### #
169173
170174 def dump(self):
171175 if not self._debug: