We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi! I want to make a very simple random walking program. Could anyone tell me why the code below doesn't work? thanks in advance `void setup(){ size(700,700); background(#E2DCE3); }
void draw(){
int x,y; x=100; y=200;
int r = (int)random(0,4);
if(r==0){ x++; }else if(r==1){ y++; }else if(r==2){ x--; }else{ y--; }
point(x,y); }`
Answers
This belongs before setup ()
int x,y;
x=100; y=200;
Otherwise you reset it all the time
Thank you so much :D
;-)