MCPcopy Create free account
hub / github.com/ActiveState/code / COD

Class COD

recipes/Python/578366_The_Normal_Cow/recipe-578366.py:11–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9################################################################################
10
11class COD:
12
13 def __init__(self, code):
14 for ins in code:
15 assert 0 <= ins < len(INS)
16 self.cod = code
17 self.pos = 0
18
19 def get(self):
20 return self.cod[self.pos]
21
22 def inc(self):
23 self.pos += 1
24 if self.pos == len(self.cod):
25 raise SystemExit
26
27 def dec(self):
28 self.pos -= 1
29 assert self.pos >= 0
30
31################################################################################
32

Callers 1

engineFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected