diff options
author | Marion <marion.zepf@gmail.com> | 2013-08-03 11:20:01 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-08-03 11:20:01 (GMT) |
commit | e9db4dfee7b8faec0728593229dc73be7c692c2f (patch) | |
tree | 843d3135b8ef7d3decf2906602026d3a8e78976e /TurtleArt/tabasics.py | |
parent | 86693c65ae0d70471131c6cdfbefbcbf87411c55 (diff) |
add Primitives for the 'pen up' and 'pen down' commands
- when converting a Primitive to an AST, convert all its constant arguments
Diffstat (limited to 'TurtleArt/tabasics.py')
-rw-r--r-- | TurtleArt/tabasics.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/TurtleArt/tabasics.py b/TurtleArt/tabasics.py index b3e2cdd..35462a5 100644 --- a/TurtleArt/tabasics.py +++ b/TurtleArt/tabasics.py @@ -436,8 +436,7 @@ used in place of a number block)'), self.tw.lc.def_prim( 'penup', 0, - lambda self: - self.tw.turtles.get_active_turtle().set_pen_state(False)) + Primitive(Turtle.set_pen_state, constant_args={0: False})) palette.add_block('pendown', style='basic-style-extended-vertical', @@ -448,8 +447,7 @@ used in place of a number block)'), self.tw.lc.def_prim( 'pendown', 0, - lambda self: - self.tw.turtles.get_active_turtle().set_pen_state(True)) + Primitive(Turtle.set_pen_state, constant_args={0: True})) palette.add_block('penstate', style='boolean-block-style', |