aswartzell.net Letter

void setup() {
  size(455, 455);
  background(255);
  smooth();

  frameRate(10);

  textSize(400);
  textAlign(CENTER, CENTER);
  
  c[0] = 'A';
  c[1] = 'B';
  c[2] = 'C';
  c[3] = 'D';
  c[4] = 'E';
  c[5] = 'F';
  c[6] = 'G';
  c[7] = 'H';
  c[8] = 'I';
  c[9] = 'J';
  c[10] = 'K';
  c[11] = 'L';
  c[12] = 'M';
  c[13] = 'N';
  c[14] = 'O';
  c[15] = 'P';
  c[16] = 'Q';
  c[17] = 'R';
  c[18] = 'S';
  c[19] = 'T';
  c[20] = 'U';
  c[21] = 'V';
  c[22] = 'W';
  c[23] = 'X';
  c[24] = 'Y';
  c[25] = 'Z';
}

char[] c = new char[26];
int n;
boolean stop = false;
boolean beep = false;

int m = millis();
int start = m;
int seconds = m / 1000;
int minutes = seconds / 60;
int hours = minutes / 60;
int days = hours / 24;

void draw() {
  background(255);
  fill(0);

  if (!stop) {
    n = parseInt(random(0, 25));
    while (n == 23 || n == 25 || n == 16 || n == 24)
      n = parseInt(random(0, 25));
  }

  text(c[n], width/2, height/2);
}

void keyPressed() {
  if (stop) {
    stop = false;
    beep = false;
  }
  else {
    stop = true;
    start = millis();
  }
}

void mousePressed() {
  if (stop) {
    stop = false;
    beep = false;
  }
  else {
    stop = true;
    start = millis();
  }
}

Above is a simplified version of a script that I wrote to replace a lost die for the game Scattergories. Click to pick a new random letter. The original code, posted below, also includes a 3 minute timer that starts when the letter is selected: