Move a onto b Where a and b are block numbers, puts block a onto block b after returning any blocks that are stacked on top of blocks a and b to their initial positions.
(self, a, b)
| 24 | return a, b |
| 25 | |
| 26 | def moveOnto(self, a, b): |
| 27 | """ |
| 28 | Move a onto b |
| 29 | |
| 30 | Where a and b are block numbers, puts block a onto block b |
| 31 | after returning any blocks that are stacked on top of blocks |
| 32 | a and b to their initial positions. |
| 33 | """ |
| 34 | # Get the actual block objects |
| 35 | a, b = self._getBlocks(a, b) |
| 36 | if not a: return # Ignore bad indexes |
| 37 | # Return blocks ontop of a to original positions (in reverse order of course) |
| 38 | a.removeBlocksFromAbove() |
| 39 | # Return blocks ontop of b to original positions |
| 40 | b.removeBlocksFromAbove() |
| 41 | # Move block a on top of block b |
| 42 | a.moveTo(b.position) |
| 43 | |
| 44 | def moveOver(self, a, b): |
| 45 | """ |
no test coverage detected