# Need serious help with a circle program

• 04-19-2002
CheeseMonkey
Need serious help with a circle program
I've had some serious trouble writing a program that creates a circle, and larger circles around that one depending on how many the user inputs.

the user enters the number of circles he/she wants and then it goes into this while loop...

say x = 1.5 at start and r = .5

while(num>0)
{
Movepen(1.5, x);
DrawArc(r, 0, 360);
x =+ .2;
r =+ .2;
num--;
}

but this doesn't work! i don't get it. any help would be appreciated, even if you write the program for me, i just want to understand how to do this!

oh yeah... x and r are floating point variables and there is an InitGraph() function in there

and most the time i only get 2 circles no matter how many i enter.
thanks
• 04-20-2002
ygfperson
rofl.... i'm sorry, it's just the stupidest mistake, everyone makes them, but its funny when they foul up your hard earned time...

anyway:
r=+ .2;
x=+ .2;

means r = .2
x = .2
what you want is:

r += .2;
x += .2;

you get only 2 circles because x and r are at their starting values, then they're both .2 for all loops afterward

//edit: oh, wait, you need "serious" help. look elsewhere :D
• 04-20-2002
CheeseMonkey
oh my god! i'm such a dumbass, thankyou for your help! i've been working on this for a week!