Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tablock.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2012-07-09 21:13:32 (GMT)
committer Walter Bender <walter.bender@gmail.com>2012-07-09 21:13:32 (GMT)
commit72042fc36f503894741ea4086bb89076b58542dc (patch)
tree815578c96a569af52228af5376bfd3c54ca4093a /TurtleArt/tablock.py
parentc288a269deee737c34e8b2415da17a75fda82349 (diff)
fix problem with nested while loops
Diffstat (limited to 'TurtleArt/tablock.py')
-rw-r--r--TurtleArt/tablock.py6
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))