How can we help?

Hi!

It looks like you're not incrementing your i variable in the while loop, so the loop is running continuously. You first define i = 0, but you never update the value of i after that, so i will always be less than 401. To fix this, you need to add i += 10 somewhere inside your while loop.

I hope this helps! Please let me know if you have any additional questions!

but just as i type:

`var i = 0;while(i<401){     line(i,0,i,400);     i+=10}`

now that you told me but, immediately, the error pops up.

Is something wrong?

In the code that you've posted above, I get an error because you're missing a semi-colon after i += 10. After adding the semi-colon, the code runs without errors on my end.

Here is what it should look like:

`var i = 0;while (i < 401) {    line(i, 0, i, 400);    i += 10;}`

thanks!

Hi!

I have a question:

`var myParticles = function(num,c){  var x = random(0,400);  var y = random(0,400);};`
`myParticles(100,'blue');`

*c: color

_________________________________________________________________________

my question is, how do i make the code color the particles(circles) get colored with the second string parameter i type in the function call, and how do i make the screen place the amount of particles i type in the the first parameter and make it place it randomly and not on one spot.

you need to define a new object, such as:

`particleA = new myParticles(100, 'blue');`

if you want to have a number of particles of a random size, you could use an array and repeat command such as:

`var Particles = [];for (var i = 0; i < 10; i++) {   var Particles[i] = new myParticles(random(30, 100), [(random(1,255),random(1,255),random(1,255)])]`

And then use the RGB array of the particles to generate its colour.

For your object, you could define colour by:

`var myParticles = function(num,c){   this.x = random(0,400);   this.y = random(0,400);   this.colour = c;   this.size = num;};`

And then you would need a "display" prototype, such as:

`myParticles.prototype.display = function() {   fill(this.colour);   ellipse(this.x, this.y, this.size, this.size);}   //then you would call the display prototype`

I wrote this code

var x = 0;
while(x < 400) {
text(1, 5, 10);
x += -20;
}

and oh noes guy got angry at me. whats wrong?