Computer Science Canada cant switch color over to blue from black.. |
Author: | dani190 [ Sat Dec 17, 2005 12:17 pm ] | ||
Post subject: | cant switch color over to blue from black.. | ||
hey guys i cant switch the color from black to blue it will just stop at the end of the black loop also how can i copy my whole code again and just do it with blue background.when i tried it, it said variable already in use.
|
Author: | Cervantes [ Sat Dec 17, 2005 12:24 pm ] | ||||
Post subject: | |||||
You can't just copy and paste all your code because that will redeclare a bunch of variables that have already been declared. Look at this, for example:
More importantly, copying and pasting code is a bad idea. It would be better to use a looping construct. If you want to do something twice, use a for loop.
Also, it's generally a bad idea to be declaring variables inside your loop. Declare them outside, modify them inside. |
Author: | dani190 [ Sat Dec 17, 2005 12:30 pm ] | ||
Post subject: | |||
Quote: More importantly, copying and pasting code is a bad idea. It would be better to use a looping construct. If you want to do something twice, use a for loop.
Also, it's generally a bad idea to be declaring variables inside your loop. Declare them outside, modify them inside what you were talking about the for i:1..2 i dont even understand what that means could you please exsplain it |
Author: | Cervantes [ Sat Dec 17, 2005 12:40 pm ] |
Post subject: | |
You've never used for loops, before? We've got a tutorial on them. [Turing Tutorials] -> Turing Walkthrough -> Loops and For loops |