forked from AllenDowney/ThinkPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlumpy_diag05.py
More file actions
36 lines (23 loc) · 620 Bytes
/
Copy pathlumpy_diag05.py
File metadata and controls
36 lines (23 loc) · 620 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/python
"""
Code for use with Think Python: An Introduction to Software Design
Copyright 2010 Allen B. Downey
Distributed under the GNU General Public License at gnu.org/licenses/gpl.html.
"""
from swampy.TurtleWorld import Turtle
import Lumpy
# create a Lumpy object and capture reference state
lumpy = Lumpy.Lumpy()
lumpy.opaque_class(Turtle)
lumpy.make_reference()
# run the test code
z = 5
bob = Turtle()
for i in range(3):
x = i
def function(parameter):
local = parameter + 1
# draw the state while function is running
lumpy.object_diagram()
variable = 3
function(variable+1)