From 6026338216f3da74d7ecab915bdb7528a989f903 Mon Sep 17 00:00:00 2001 From: Marion Date: Thu, 06 Jun 2013 17:04:47 +0000 Subject: add some in-code documentation (test commit) --- (limited to 'TurtleArt') diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 29d05d9..8acc1b8 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -188,10 +188,14 @@ class LogoCode: return sym def run_blocks(self, code): + """Run code generated by generate_code(). + """ self.start_time = time() self._setup_cmd(code) def generate_code(self, blk, blocks): + """ Generate code to be passed to run_blocks() from a stack of blocks. + """ for k in self.stacks.keys(): self.stacks[k] = None self.stacks['stack1'] = None @@ -849,7 +853,9 @@ class LogoCode: def _expand_forever(self, b, blk, blocks): """ Expand a while or until block into: forever, ifelse, stopstack - Expand a forever block to run in a separate stack """ + Expand a forever block to run in a separate stack + Parameters: the loop block, the top block, all blocks. + Return the start block of the expanded loop, and all blocks.""" # TODO: create a less brittle way of doing this; having to # manage the connections and flows locally means we may run -- cgit v0.9.1