Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm trying to understand why my code isn't working. this is a piece of code that I'm creating for a game in canvas. I want to dynamically create an object to capture the radius, x and y coordinates. Eventually this will become a setInterval functon If i can get the console.log to produce I'll be good.

var i;
var circles = {};
for (i = 0; i>10; i++){
  circles[i]= {
    d:Math.floor(Math.random()*50),
    x:Math.floor(Math.random()*500),
    y:Math.floor(Math.random()*500)
    };
    console.log(circles[i].d, circles[i].x, circles[i].x);
};
share|improve this question

1 Answer 1

up vote 4 down vote accepted
for (i = 0; i>10; i++){

should be

for (i = 0; i<10; i++){
share|improve this answer
1  
thanks, i guess that happens when tired –  user1249220 Mar 5 '12 at 7:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.