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

Username:   Password: 
 RegisterRegister   
 need help for twinkle rings!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic
Author Message
Lucy Xu




PostPosted: Wed May 01, 2013 10:32 pm   Post subject: need help for twinkle rings!!

What is it you are trying to achieve?
i am trying to make a moon with some twinkle rings although normally the moon don't have twinkle rings.


What is the problem you are having?
i don't know how to make rings twinkle


Describe what you have tried to solve this problem
<Answer Here>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<%draw moon
drawfilloval(80,580,30,30,yellow)
%draw rings
drawoval(80,580,35,35,yellow)
drawoval(80,580,40,40,yellow)
drawoval(80,580,45,45,yellow)>



Please specify what version of Turing you are using
<Answer Here>
 
Sponsor
Sponsor
Sponsor
sponsor
Panphobia




PostPosted: Wed May 01, 2013 11:12 pm   Post subject: RE:need help for twinkle rings!!

What do you mean by twinkling? Do you mean them changing colours after set intervals? If so you want to have a loop, thats a start, and also colours can be represented as integers, that should be a big clue.
 
Lucy Xu




PostPosted: Thu May 02, 2013 1:00 pm   Post subject: RE:need help for twinkle rings!!

i want it to be changing color. can u give a a turing code?
 
Panphobia




PostPosted: Thu May 02, 2013 1:14 pm   Post subject: RE:need help for twinkle rings!!

No I will not write the program for you, but I can give you an example in pseudocode'ish
code:
loop
counter++
if counter = (number)
        counter = 0
        change to random color
end loop
so basically I did not put in a break condition, so you can do that yourself, but basically how it works is you want your rings to change colour every time counter hits a certain number so that makes the twinkle faster or slower, and you reset it so that it can repeat
 
Lucy Xu




PostPosted: Thu May 02, 2013 8:58 pm   Post subject: RE:need help for twinkle rings!!

thanks~~
 
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh pageAdd this topic to your bookmarks (CTRL-D) View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: