diff options
author | Pootle daemon <pootle@pootle.sugarlabs.org> | 2012-07-10 04:32:17 (GMT) |
---|---|---|
committer | Pootle daemon <pootle@pootle.sugarlabs.org> | 2012-07-10 04:32:17 (GMT) |
commit | d1644f0fd980c864f94ad8b16db11d448111e69b (patch) | |
tree | 9516d41e9a262de2a5cb7f80a3f8b17dff2f76e7 /TurtleArt/tablock.py | |
parent | 9240c9686816e6a6e09973dc6a3b2c356df1eb9d (diff) | |
parent | 72042fc36f503894741ea4086bb89076b58542dc (diff) |
Merge branch 'master' of git.sugarlabs.org:turtleart/mainline
Diffstat (limited to 'TurtleArt/tablock.py')
-rw-r--r-- | TurtleArt/tablock.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/TurtleArt/tablock.py b/TurtleArt/tablock.py index 7e48d43..dd1ac04 100644 --- a/TurtleArt/tablock.py +++ b/TurtleArt/tablock.py @@ -49,6 +49,12 @@ class Blocks: else: return(self.list[i]) + def swap(self, blk1, blk2): + i1 = self.list.index(blk1) + i2 = self.list.index(blk2) + self.list[i1] = blk2 + self.list[i2] = blk1 + def length_of_list(self): return(len(self.list)) |