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

Username:   Password: 
 RegisterRegister   
 How do I make this traingle flash with colors?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
aqazwsx1




PostPosted: Fri Oct 24, 2008 9:34 pm   Post subject: How do I make this traingle flash with colors?

How do I make the triangle flash with colors? Thanks in advance.

for i : 1 .. 100


drawdot (70 + i, 100 + i, red)
drawdot (170 + i, 200 - i, red)
drawdot (270 - i - i, 100, red)
delay (5)

end for
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Oct 24, 2008 9:51 pm   Post subject: RE:How do I make this traingle flash with colors?

instead of colour "red", use another colour.

Keep in mind that "red" is just a constant for an integer that represents that number
code:

put red
put blue

So you can use some math to take advantage of the changing value of i, instead of using if statements.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
isaiahk9




PostPosted: Sat Oct 25, 2008 7:06 am   Post subject: RE:How do I make this traingle flash with colors?

if you wanted random colors flashing, make a random variable of a number between 1 and 255 outside of the for loop, and just call that as the color for your . . . dots? Triangle? Whatever.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: