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

Username:   Password: 
 RegisterRegister   
 How to make ripples shrink
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rcmp1234




PostPosted: Sat Apr 05, 2008 5:44 pm   Post subject: How to make ripples shrink

I am supposed to write a program showing the ripples shrinking once it reaches the top of the window
I tried using decreasing radius but it only shows one hollow circle shrinking and thats not what I want...I want the circles to disappear one by one

How do i do that?
Heres my program

const centerx := maxx div 2
const centery := maxy div 2
for radius : 1 .. centery by 10
delay (30)
drawoval (centerx, centery, radius, radius, magenta)
end for

for decreasing radius : centery .. 1 by 10

delay (30)
cls
drawoval (centerx, centery, radius, radius, magenta)

end for

Any help would be greatly appreciated

thanks
Sponsor
Sponsor
Sponsor
sponsor
andrew.




PostPosted: Sat Apr 05, 2008 6:26 pm   Post subject: Re: How to make ripples shrink

Here you go.

I don't know why, but the decreasing moves the position by 2. It's weird but here.

Turing:
const centerx := maxx div 2
const centery := maxy div 2
for radius : 1 .. centery by 10
    delay (30)
    drawoval (centerx, centery, radius, radius, magenta)
end for

for decreasing radius : centery .. 1 by 10
    delay (30)
    drawoval (centerx, centery, radius+2, radius+2, white)
end for


P.S. Next time use the syntax="Turing" tags.
rcmp1234




PostPosted: Sat Apr 05, 2008 6:30 pm   Post subject: RE:How to make ripples shrink

Thanks andrew!!
andrew.




PostPosted: Sat Apr 05, 2008 9:03 pm   Post subject: Re: How to make ripples shrink

No problem. Mr. Green
Mackie




PostPosted: Sat Apr 05, 2008 10:13 pm   Post subject: RE:How to make ripples shrink

andrew. don't do his work for him. He'll never learn anything that way, plus it is against the rules of the forum.
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: