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

Method moveOver

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

Move a over b Where a and b are block numbers, puts block a onto the top of the stack containing block b, after returning any blocks that are stacked on top of block a to their initial positions.

(self, a, b)

Source from the content-addressed store, hash-verified

42 a.moveTo(b.position)
43
44 def moveOver(self, a, b):
45 """
46 Move a over b
47
48 Where a and b are block numbers, puts block a onto the top of the stack
49 containing block b, after returning any blocks that are stacked on top
50 of block a to their initial positions.
51 """
52 a, b = self._getBlocks(a, b)
53 if not a: return # Ignore bad indexes
54 # Move all blocks in a's stack to their original positions
55 a.removeBlocksFromAbove()
56 # Move a to the top of b's stack
57 a.moveTo(b.position)
58
59 def pileOnto(self, a, b):
60 """

Callers 1

test1Function · 0.95

Calls 3

_getBlocksMethod · 0.95
removeBlocksFromAboveMethod · 0.80
moveToMethod · 0.45

Tested by

no test coverage detected