Computer Science Canada

need help for twinkle rings!!

Author:  Lucy Xu [ 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>

Author:  Panphobia [ 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.

Author:  Lucy Xu [ 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?

Author:  Panphobia [ 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

Author:  Lucy Xu [ Thu May 02, 2013 8:58 pm ]
Post subject:  RE:need help for twinkle rings!!

thanks~~


: