This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hey everyone, I have been working on this problem for school and I am stuck on how to finish a part of it. I was wondering if anyone could look at it and see what my problem is. I am using the addLine() function to draw several lines to form a tree and from there I want to generate 5 trees total using a for loop statement. I am getting stuck on how to make the for loop to solve this problem. Thank you for reading this post, and I appreciate any help that I receive.
canvas = getMediaPath("640X480.jpg")
canvasf = makePicture(canvas)
str = "This is my home."
addText(canvasf, 20,20,str, black)
addText(canvasf, 21,20,str, black)
addRect(canvasf, 299, 19, 301, 71)
addRectFilled(canvasf, 300, 20, 300, 70, cyan)
addRect(canvasf, 350, 90, 200, 150)
addRect(canvasf, 390, 120, 50, 50)
addRect(canvasf, 460, 120, 50, 50)
for x in range(40,240,50):
for y in range(90, 240):
Joined: Oct 19, 2012
Thanks I figured it out, sorry to make a thread for nothing. This is what I came up with.