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

Method _getBlocks

recipes/Python/361168_Vpython_example/recipe-361168.py:14–24  ·  view source on GitHub ↗

Pass two zero based numbers and get two block objects. All checking done, returns (None, None) if the indexes are wrong

(self, a, b)

Source from the content-addressed store, hash-verified

12 self.stacks = stacks
13
14 def _getBlocks(self, a, b):
15 """Pass two zero based numbers and get two
16 block objects. All checking done, returns (None, None)
17 if the indexes are wrong
18 """
19 if not (0 < a < self.stacks.blockCount): return None, None
20 if not (0 < b < self.stacks.blockCount): return None, None
21 a = self.stacks.blocks[a]
22 b = self.stacks.blocks[b]
23 if a.position == b.position: return None, None
24 return a, b
25
26 def moveOnto(self, a, b):
27 """

Callers 4

moveOntoMethod · 0.95
moveOverMethod · 0.95
pileOntoMethod · 0.95
pileOverMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected