Issue with my code

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(){

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);

  theta=theta + speed; 


I’m getting an unexpected token: (

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