# Issue with my code

**URL:** <https://discourse.processing.org/t/issue-with-my-code/29822>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [May 3, 2021, 5:58pm UTC](https://discourse.processing.org/t/issue-with-my-code/29822 "2021-05-03T17:58:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pokeyace](https://avatars.discourse-cdn.com/v4/letter/p/a8b319/32.png) [@Pokeyace](https://discourse.processing.org/u/Pokeyace)\
**Post date:** [May 3, 2021, 5:58pm UTC](https://discourse.processing.org/t/issue-with-my-code/29822/1 "2021-05-03T17:58:21Z")

</div>

int r=25; //small circle  
int R=160; //big circle  
int d=100; //distance from small circle center  
float theta=0;  
float speed = 0.008; //determines how fast theta is increased, higher speed = faster program but lower quality.

float k =2PI(lcm(r,R)/R); //important in stopping the program when shape is complete

int lcm(int number1, int number2) { //used in calculation of k  
if (number1 == 0 || number2 == 0) {  
return 0;  
}  
int absNumber1 = Math.abs(number1);  
int absNumber2 = Math.abs(number2);  
int absHigherNumber = Math.max(absNumber1, absNumber2);  
int absLowerNumber = Math.min(absNumber1, absNumber2);  
int lcm = absHigherNumber;  
while (lcm % absLowerNumber != 0) {  
lcm += absHigherNumber;  
}  
return lcm;  
}

void setup(){  
size(500,500);  
background(255);  
stroke(color(200,75,150));  
}

void draw(){

```
translate(width/2, height/2); //centers the shape

```

for(int i=0; i\<1000; i++);{  
if(theta\<=k){ //stops the program when the shape is complete  
float x = (R-r)cos(theta) + dcos((R-r)theta/r);  
float y = (R-r)sin(theta) - dsin((R-r)theta/r);  
ellipse(x,y,1,1);

```
  theta=theta + speed; 

```

}  
}  
}

I’m getting an unexpected token: (

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [May 3, 2021, 6:39pm UTC](https://discourse.processing.org/t/issue-with-my-code/29822/2 "2021-05-03T18:39:43Z")

</div>

One too many} at the end

And you don’t want ; at for loop here: );{

Hint use ctrl-t to get automatically indents

Check indents then
