Random elements different positions

I can’t run the code

widthGrid, heightGrid and other are not known

please check your post