Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Nooby help!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Wreathe




PostPosted: Sun Apr 03, 2011 6:36 pm   Post subject: Nooby help!

for i: 1..100
Draw.FillOval (i,i,i,i,yellow)
delay(50)
Draw.FillOval (i,i,i,i,white)
end for

it's basically a sun! After the variable 'i' goes all the way to 100, i want to keep the sun wherever or however it is right there because after the variable 'i' reaches 100, the sun disappears! How do i solve this? THX a bunch for help!
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Apr 03, 2011 6:39 pm   Post subject: RE:Nooby help!

Bad choice of a title -- not descriptive.

Describe what happens on the 100th iteration of the loop (all of the commands that happen inside the loop, and their values).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
apython1992




PostPosted: Sun Apr 03, 2011 6:42 pm   Post subject: RE:Nooby help!

Instead of drawing a white oval over top to "clear" the screen, you could use "cls" to simply clear the screen, regardless of its background color. But you only want to clear the screen in between drawing the yellow ovals. Do you want to clear the screen when i equals 100? If not, how would that look in code?
Wreathe




PostPosted: Sun Apr 03, 2011 6:45 pm   Post subject: RE:Nooby help!

I do not want the sun to clear up! With the code i'm using right now, the sun dissapears right after the 'i' reaches 100. I want the sun to stay!
Tony




PostPosted: Sun Apr 03, 2011 6:48 pm   Post subject: RE:Nooby help!

Yes, it disappears because you erase it every time, including the 100th time.

As it's been asked:
apython1992 @ Sun Apr 03, 2011 6:42 pm wrote:
Do you want to clear the screen when i equals 100? If not, how would that look in code?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: