Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/tautils.py
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r--TurtleArt/tautils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py
index e24d061..862554b 100644
--- a/TurtleArt/tautils.py
+++ b/TurtleArt/tautils.py
@@ -773,6 +773,17 @@ def find_top_block(blk):
return blk
+def find_bot_block(blk):
+ ''' Find the bottom block in a stack. '''
+ if blk is None:
+ return None
+ if len(blk.connections) == 0:
+ return blk
+ while blk.connections[-1] is not None:
+ blk = blk.connections[-1]
+ return blk
+
+
def find_start_stack(blk):
''' Find a stack with a 'start' block on top. '''
if blk is None: