int x,y,xStep,yStep; int jump; void setup(){ size(300,300); x=y=150; background(255); jump=1; } void draw(){ xStep = int(random(99)); yStep = int(random(99)); if(xStep >= 50){ x += jump; } else { x -= jump; } if(x<0){ x=0; } else if (x>width){ x=width; } if(yStep >= 50){ y += jump; } else { y -= jump; } if(y<0){ y=0; } else if (y>height){ y=height; } stroke(0,0,255); point(x,y); }