I was just messing around with the while loop, testing it vs the for loop, when this graphical glitch occurred. This happens on an inconsistent basis, so I do refresh it to get results, but occasionally the screen will be split into horizontal lines, each with their different color. Why is this occurring?

int i = 0;

void setup() {
  size(400, 400);
void draw() {
  while(i < 1) {

void mousePressed() {
  i += 1;

0 Answers