i wrote a code that should, generate a random x, from 1-10 and then make a y the number that it needs to complete 10. it then should try to devide it by something it can be devided by. then it shows a visual for me to see if it lands on the middle eventually and a print to be sure. however it does not work. why?
and how do i get around it?
int x=(int(random(10-1)));
int y= 10-x;
void setup(){
size(10,10);
print(x);
print(y);
}
void draw(){
background(255,255,255);
fill(0,0,0);
if(x==0){x=(int(random(10-1)));}
if(x>y){y=y+(int(y/3));}
if(y>x){x=x+(int(x/3));}
ellipse(width-x, height/2, 1,1);
if(y==x){
stop();}
}