• fullscreen
  • Time.pde
  • int s;
    int m;
    
    void setup(){
      size(360, 360);
      background(255);
      s = 0;
      m = 0;
    }
    
    void draw(){
      s = second();
      m = minute();
      
    //SECONDS
    //TOP - 15 seconds
      if(s == 1){
        background(255);
      line(20, 40, 40, 20);//1
      }
      if(s == 2){
      line(40, 20, 60, 40);//2
      }
      if(s == 3){
      line(60, 40, 80, 20);//3
      }
      if(s == 4){
      line(80, 20, 100, 40);//4
      }
      if(s == 5){
      line(100, 40, 120, 20);//5
      }
      if(s == 6){
      line(120, 20, 140, 40);//6
      }
      if(s == 7){
      line(140, 40, 160, 20);//7
      }
      if(s == 8){
      line(160, 20, 180, 40);//8
      }
      if(s == 9){
      line(180, 40, 200, 20);//9
      }
      if(s == 10){
      line(200, 20, 220, 40);//10
      }
      if(s == 11){
      line(220, 40, 240, 20);//11
      }
      if(s == 12){
      line(240, 20, 260, 40);//12
      }
      if(s == 13){
      line(260, 40, 280, 20);//13
      }
      if(s == 14){
      line(280, 20, 300, 40);//14
      }
      if(s == 15){
      line(300, 40, 320, 20);//15
      }
    //RIGHT - 30 seconds
      if(s == 16){
      line(320, 20, 340, 40);//16
      }
      if(s == 17){
      line(340, 40, 320, 60);//17
      }
      if(s == 18){
      line(320, 60, 340, 80);//18
      }
      if(s == 19){
      line(340, 80, 320, 100);//19
      }
      if(s == 20){
      line(320, 100, 340, 120);//20
      }
      if(s == 21){
      line(340, 120, 320, 140);//21
      }
      if(s == 22){
      line(320, 140, 340, 160);//22
      }
      if(s == 23){
      line(340, 160, 320, 180);//23
      }
      if(s == 24){
      line(320, 180, 340, 200);//24
      }
      if(s == 25){
      line(340, 200, 320, 220);//25
      }
      if(s == 26){
      line(320, 220, 340, 240);//26
      }
      if(s == 27){
      line(340, 240, 320, 260);//27
      }
      if(s == 28){
      line(320, 260, 340, 280);//28
      }
      if(s == 29){
      line(340, 280, 320, 300);//29
      }
      if(s == 30){
      line(320, 300, 340, 320);//30
      }
    //BOTTOM - 45 seconds
      if(s == 31){
      line(340, 320, 320, 340);//31
      }
      if(s == 32){
      line(320, 340, 300, 320);//32
      }
      if(s == 33){
      line(300, 320, 280, 340);//33
      }
      if(s == 34){
      line(280, 340, 260, 320);//34
      }
      if(s == 35){
      line(260, 320, 240, 340);//35
      }
      if(s == 36){
      line(240, 340, 220, 320);//36
      }
      if(s == 37){
      line(220, 320, 200, 340);//37
      }
      if(s == 38){
      line(200, 340, 180, 320);//38
      }
      if(s == 39){
      line(180, 320, 160, 340);//39
      }
      if(s == 40){
      line(160, 340, 140, 320);//40
      }
      if(s == 41){
      line(140, 320, 120, 340);//41
      }
      if(s == 42){
      line(120, 340, 100, 320);//42
      }
      if(s == 43){
      line(100, 320, 80, 340);//43
      }
      if(s == 44){
      line(80, 340, 60, 320);//44
      }
      if(s == 45){
      line(40, 340, 60, 320);//45
      }
    //LEFT - 59 seconds
      if(s == 46){
      line(20, 320, 40, 340);//46
      }
      if(s == 47){
      line(40, 300, 20, 320);//47
      }
      if(s == 48){
      line(20, 280, 40, 300);//48
      }
      if(s == 49){
      line(40, 260, 20, 280);//49
      }
      if(s == 50){
      line(20, 240, 40, 260);//50
      }
      if(s == 51){
      line(40, 220, 20, 240);//51
      }
      if(s == 52){
      line(20, 200, 40, 220);//52
      }
      if(s == 53){
      line(40, 180, 20, 200);//53
      }
      if(s == 54){
      line(20, 160, 40, 180);//54
      }
      if(s == 55){
      line(40, 140, 20, 160);//55
      }
      if(s == 56){
      line(20, 120, 40, 140);//56
      }
      if(s == 57){
      line(40, 100, 20, 120);//57
      }
      if(s == 58){
      line(20, 80, 40, 100);//58
      }
      if(s == 59){
      line(40, 60, 20, 80);//59
      }
      if(s == 0){
      line(20, 40, 40, 60);//0
      }
    
    //MINUTES
    //TOP - 15 minutes
    if(m > 0){
    ellipse(20, 20, 5, 5);//1
    }
    if(m > 1){
    ellipse(40, 40 , 5, 5);//2
    }
    if(m > 2){
    ellipse(60, 20, 5, 5);//3
    }
    if(m > 3){
    ellipse(80, 40, 5, 5);//4
    }
    if(m > 4){
    ellipse(100, 20, 5, 5);//5
    }
    if(m > 5){
    ellipse(120, 40, 5, 5);//6
    }
    if(m > 6){
    ellipse(140, 20, 5, 5);//7
    }
    if(m > 7){
    ellipse(160, 40, 5, 5);//8
    }
    if(m > 8){
    ellipse(180, 20, 5, 5);//9
    }
    if(m > 9){
    ellipse(200, 40, 5, 5);//10
    }
    if(m > 10){
    ellipse(220, 20, 5, 5);//11
    }
    if(m > 11){
    ellipse(240, 40, 5, 5);//12
    }
    if(m > 12){
    ellipse(260, 20, 5, 5);//13
    }
    if(m > 13){
    ellipse(280, 40, 5, 5);//14
    }
    if(m > 14){
    ellipse(300, 20, 5, 5);//15
    }
    //RIGHT - 30 minutes
    if(m > 15){
    ellipse(320, 40, 5, 5);//16
    }
    if(m > 16){
    ellipse(340, 20, 5, 5);//17
    }
    if(m > 17){
    ellipse(340, 60, 5, 5);//18
    }
    if(m > 18){
    ellipse(320, 80, 5, 5);//19
    }
    if(m > 19){
    ellipse(340, 100, 5, 5);//20
    }
    if(m > 20){
    ellipse(320, 120, 5, 5);//21
    }
    if(m > 21){
    ellipse(340, 140, 5, 5);//22
    }
    if(m > 22){
    ellipse(320, 160, 5, 5);//23
    }
    if(m > 23){
    ellipse(340, 180, 5, 5);//24
    }
    if(m > 24){
    ellipse(320, 200, 5, 5);//25
    }
    if(m > 25){
    ellipse(340, 220, 5, 5);//26
    }
    if(m > 26){
    ellipse(320, 240, 5, 5);//27
    }
    if(m > 27){
    ellipse(340, 260, 5, 5);//28
    }
    if(m > 28){
    ellipse(320, 280, 5, 5);//29
    }
    if(m > 29){
    ellipse(340, 300, 5, 5);//30
    }
    //BOTTOM - 45 minutes
    if(m > 30){
    ellipse(320, 320, 5, 5);//31
    }
    if(m > 31){
    ellipse(340, 340, 5, 5);//32
    }
    if(m > 32){
    ellipse(300, 340, 5, 5);//33
    }
    if(m > 33){
    ellipse(280, 320, 5, 5);//34
    }
    if(m > 34){
    ellipse(260, 340, 5, 5);//35
    }
    if(m > 35){
    ellipse(240, 320, 5, 5);//36
    }
    if(m > 36){
    ellipse(220, 340, 5, 5);//37
    }
    if(m > 37){
    ellipse(200, 320, 5, 5);//38
    }
    if(m > 38){
    ellipse(180, 340, 5, 5);//39
    }
    if(m > 39){
    ellipse(160, 320, 5, 5);//40
    }
    if(m > 40){
    ellipse(140, 340, 5, 5);//41
    }
    if(m > 41){
    ellipse(120, 320, 5, 5);//42
    }
    if(m > 42){
    ellipse(100, 340, 5, 5);//43
    }
    if(m > 43){
    ellipse(80, 320, 5, 5);//44
    }
    if(m > 44){
    ellipse(60, 340, 5, 5);//45
    }
    //LEFT - 59 minutes
    if(m > 45){
    ellipse(40, 320, 5, 5);//46
    }
    if(m > 46){
    ellipse(20, 340, 5, 5);//47
    }
    if(m > 47){
    ellipse(20, 300, 5, 5);//48
    }
    if(m > 48){
    ellipse(40, 280, 5, 5);//49
    }
    if(m > 49){
    ellipse(20, 260, 5, 5);//50
    }
    if(m > 50){
    ellipse(40, 240, 5, 5);//51
    }
    if(m > 51){
    ellipse(20, 220, 5, 5);//52
    }
    if(m > 52){
    ellipse(40, 200, 5, 5);//53
    }
    if(m > 53){
    ellipse(20, 180, 5, 5);//54
    }
    if(m > 54){
    ellipse(40, 160, 5, 5);//55
    }
    if(m > 55){
    ellipse(20, 140, 5, 5);//56
    }
    if(m > 56){
    ellipse(40, 120, 5, 5);//57
    }
    if(m > 57){
    ellipse(20, 100, 5, 5);//58
    }
    if(m > 58){
    ellipse(40, 80, 5, 5);//59
    }
    if(m > 59){
    ellipse(20, 60, 5, 5);
    }
    
    
    //HOUR
    ellipse(180, 180, 200, 200);
    
      println(s);
      println(m);
      
    
    //  if(s == 0){
    //  if(m == 0){
    //    background(255);
    //  }
    //  }
    }
    
    

    code

    tweaks (0)

    license

    advertisement

    Joshua Waheed

    Abstract Clock

    Add to Faves Me Likey@!
    You must login/register to add this sketch to your favorites.

    We were told to build a clock on processing. I based mine on the FROMAL COMPOSITION - Reflection.

    The 'lines' represent seconds.

    The 'dots' represent minutes.

    The 'circle' represents hours.

    You need to login/register to comment.