I'm new to processing and programming. I've just written the sketch below, When I run it, it does not work as I expected, when I put it on the web it works exactly how I intended.
Can anyone tell me what's going on, is there something wrong with my code or is there something I don't understand about how processing works?