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

Method moveTo

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

Simply puts the block on top of the stack numbered newPosition

(self, newPosition)

Source from the content-addressed store, hash-verified

146 self._position = position
147
148 def moveTo(self, newPosition):
149 """Simply puts the block on top of the stack numbered newPosition"""
150 if newPosition == self._position: return
151 stack = self.stacks[self._position]
152 stack.remove(self)
153 self._position = newPosition
154 self.stacks[newPosition].append(self)
155
156 def removeBlocksFromAbove(self):
157 """Takes all the blocks from above us and puts them in their original positions

Callers 8

set_positionMethod · 0.95
$Function · 0.45
moveOntoMethod · 0.45
moveOverMethod · 0.45
pileOntoMethod · 0.45
pileOverMethod · 0.45
removeBlocksFromAboveMethod · 0.45
moveToMethod · 0.45

Calls 2

removeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected