diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-07-02 15:40:38 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-07-02 15:40:38 (GMT) |
commit | 7f1f1c9febbd9225bd24feb2ed22957731068c69 (patch) | |
tree | e2d9f9f6b753bbccce3adbd6861fe9472da498c1 /TurtleArt/tautils.py | |
parent | 4a1135cd6b454bcb8e92d4ff117647706b1557aa (diff) |
add ability to insert flow blocks mid-stack
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r-- | TurtleArt/tautils.py | 11 |
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: |