Sunday, 8 April 2012

Clock

Clock:

SegmentsDot d;
Segments s;
SegmentsMnt m;
SegmentsSec sec;
void setup(){
size(600,200);
//noLoop();
}
void draw(){
for(int i = 0; i < 10; i ++){

}


m = new SegmentsMnt();
d = new SegmentsDot();
sec = new SegmentsSec();
d.dots();
s = new Segments();
fill(255,0,0);
if(keyPressed) {
background(0);
if (key == '0') {
s.Num0();
m.Num0();
sec.Num0();
}
if (key == '1') {
background(0);
s.Num1();
m.Num1();
sec.Num1();
}
if (key == '2') {
background(0);
s.Num2();
m.Num2();
sec.Num2();
}
if (key == '3') {
background(0);
s.Num3();
m.Num3();
sec.Num3();
}
if (key == '4') {
background(0);
s.Num4();
m.Num4();
sec.Num4();
}
if (key == '5') {
background(0);
s.Num5();
m.Num5();
sec.Num5();
}
if (key == '6') {
background(0);
s.Num6();
m.Num6();
sec.Num6();
}
if (key == '7') {
background(0);
s.Num7();
m.Num7();
sec.Num7();
}
if (key == '8') {
background(0);
s.Num8();
m.Num8();
sec.Num8();
}
if (key == '9') {
background(0);
s.Num9();
m.Num9();
sec.Num9();
}

} else {
//s.Num0();
}
}
public class Segments {

public void Num0(){
rect(20,20,10,50); // segment 1 top left vertical
rect(30,10,50,10); // segment 2 top horizontal
rect(80,20,10,50); // segment 3 top right vertical
rect(20,80,10,50); // segment 6 bottom left
rect(80,80,10,50); // segment 4 bottom right
rect(30,130,50,10); // segment 5 bottm horizontal

}


public void Num1(){ // Number 1
rect(20,20,10,50); // segment 1 top left vertical
rect(20,80,10,50); // segment 6 bottom left
}
public void Num2(){
rect(30,10,50,10); // segment 2 top horizontal
rect(80,20,10,50); // segment 3 top right vertical
rect(30,70,50,10); // segment 7 middle horizontal
rect(20,80,10,50); // segment 6 bottom left
rect(30,130,50,10); // segment 5 bottm horizontal
}
public void Num3(){
rect(30,10,50,10); // segment 2 top horizontal
rect(80,20,10,50); // segment 3 top right vertical
rect(30,70,50,10); // segment 7 middle horizontal
rect(80,80,10,50); // segment 4 bottom right
rect(30,130,50,10); // segment 5 bottm horizontal
}
public void Num4(){
rect(20,20,10,50); // segment 1 top left vertical
rect(30,70,50,10); // segment 7 middle horizontal
rect(80,20,10,50); // segment 3 top right vertical
rect(80,80,10,50); // segment 4 bottom right

}
public void Num5(){
rect(30,10,50,10); // segment 2 top horizontal
rect(20,20,10,50); // segment 1 top left vertical
rect(30,70,50,10); // segment 7 middle horizontal
rect(80,80,10,50); // segment 4 bottom right
rect(30,130,50,10); // segment 5 bottm horizontal

}
public void Num6(){
rect(30,10,50,10); // segment 2 top horizontal
rect(20,20,10,50); // segment 1 top left vertical
rect(30,70,50,10); // segment 7 middle horizontal
rect(80,80,10,50); // segment 4 bottom right
rect(30,130,50,10); // segment 5 bottm horizontal
rect(20,80,10,50); // segment 6 bottom left

}
public void Num7(){
rect(30,10,50,10); // segment 2 top horizontal
rect(80,20,10,50); // segment 3 top right vertical
rect(80,80,10,50); // segment 4 bottom right
}
public void Num8(){
rect(20,20,10,50); // segment 1 top left vertical
rect(30,10,50,10); // segment 2 top horizontal
rect(80,20,10,50); // segment 3 top right vertical
rect(30,70,50,10); // segment 7 middle horizontal
rect(20,80,10,50); // segment 6 bottom left
rect(80,80,10,50); // segment 4 bottom right
rect(30,130,50,10); // segment 5 bottm horizontal
}
public void Num9(){
rect(20,20,10,50); // segment 1 top left vertical
rect(30,10,50,10); // segment 2 top horizontal
rect(80,20,10,50); // segment 3 top right vertical
rect(30,70,50,10); // segment 7 middle horizontal
rect(80,80,10,50); // segment 4 bottom right
rect(30,130,50,10); // segment 5 bottm horizontal
}

}
public class SegmentsDot
{
public void dots(){
rect(110,40,10,10);
rect(110,90,10,10);
rect(320,40,10,10);
rect(320,90,10,10);
}
}
public class SegmentsMnt extends Segments {

int gape = 130;
int gape2 = 210;
public void Num0(){
rect(20+gape,20,10,50); // segment 1 top left vertical
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(80+gape,20,10,50); // segment 3 top right vertical
rect(20+gape,80,10,50); // segment 6 bottom left
rect(80+gape,80,10,50); // segment 4 bottom right
rect(30+gape,130,50,10); // segment 5 bottm horizontal


rect(20+gape2,20,10,50); // segment 1 top left vertical
rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(80+gape2,20,10,50); // segment 3 top right vertical
rect(20+gape2,80,10,50); // segment 6 bottom left
rect(80+gape2,80,10,50); // segment 4 bottom right
rect(30+gape2,130,50,10); // segment 5 bottm horizontal
}


public void Num1(){ // Number 1
rect(20+gape,20,10,50); // segment 1 top left vertical
rect(20+gape,80,10,50); // segment 6 bottom left

rect(20+gape2,20,10,50); // segment 1 top left vertical
rect(20+gape2,80,10,50); // segment 6 bottom left
}
public void Num2(){
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(80+gape,20,10,50); // segment 3 top right vertical
rect(30+gape,70,50,10); // segment 7 middle horizontal
rect(20+gape,80,10,50); // segment 6 bottom left
rect(30+gape,130,50,10); // segment 5 bottm horizontal

rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(80+gape2,20,10,50); // segment 3 top right vertical
rect(30+gape2,70,50,10); // segment 7 middle horizontal
rect(20+gape2,80,10,50); // segment 6 bottom left
rect(30+gape2,130,50,10); // segment 5 bottm horizontal
}
public void Num3(){
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(80+gape,20,10,50); // segment 3 top right vertical
rect(30+gape,70,50,10); // segment 7 middle horizontal
rect(80+gape,80,10,50); // segment 4 bottom right
rect(30+gape,130,50,10); // segment 5 bottm horizontal

rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(80+gape2,20,10,50); // segment 3 top right vertical
rect(30+gape2,70,50,10); // segment 7 middle horizontal
rect(80+gape2,80,10,50); // segment 4 bottom right
rect(30+gape2,130,50,10); // segment 5 bottm horizontal
}
public void Num4(){
rect(20+gape,20,10,50); // segment 1 top left vertical
rect(30+gape,70,50,10); // segment 7 middle horizontal
rect(80+gape,20,10,50); // segment 3 top right vertical
rect(80+gape,80,10,50); // segment 4 bottom right

rect(20+gape2,20,10,50); // segment 1 top left vertical
rect(30+gape2,70,50,10); // segment 7 middle horizontal
rect(80+gape2,20,10,50); // segment 3 top right vertical
rect(80+gape2,80,10,50); // segment 4 bottom right

}
public void Num5(){
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(20+gape,20,10,50); // segment 1 top left vertical
rect(30+gape,70,50,10); // segment 7 middle horizontal
rect(80+gape,80,10,50); // segment 4 bottom right
rect(30+gape,130,50,10); // segment 5 bottm horizontal

rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(20+gape2,20,10,50); // segment 1 top left vertical
rect(30+gape2,70,50,10); // segment 7 middle horizontal
rect(80+gape2,80,10,50); // segment 4 bottom right
rect(30+gape2,130,50,10); // segment 5 bottm horizontal


}
public void Num6(){
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(20+gape,20,10,50); // segment 1 top left vertical
rect(30+gape,70,50,10); // segment 7 middle horizontal
rect(80+gape,80,10,50); // segment 4 bottom right
rect(30+gape,130,50,10); // segment 5 bottm horizontal
rect(20+gape,80,10,50); // segment 6 bottom left

rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(20+gape2,20,10,50); // segment 1 top left vertical
rect(30+gape2,70,50,10); // segment 7 middle horizontal
rect(80+gape2,80,10,50); // segment 4 bottom right
rect(30+gape2,130,50,10); // segment 5 bottm horizontal
rect(20+gape2,80,10,50); // segment 6 bottom left

}
public void Num7(){
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(80+gape,20,10,50); // segment 3 top right vertical
rect(80+gape,80,10,50); // segment 4 bottom right

rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(80+gape2,20,10,50); // segment 3 top right vertical
rect(80+gape2,80,10,50); // segment 4 bottom right
}
public void Num8(){
rect(20+gape,20,10,50); // segment 1 top left vertical
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(80+gape,20,10,50); // segment 3 top right vertical
rect(30+gape,70,50,10); // segment 7 middle horizontal
rect(20+gape,80,10,50); // segment 6 bottom left
rect(80+gape,80,10,50); // segment 4 bottom right
rect(30+gape,130,50,10); // segment 5 bottm horizontal

rect(20+gape2,20,10,50); // segment 1 top left vertical
rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(80+gape2,20,10,50); // segment 3 top right vertical
rect(30+gape2,70,50,10); // segment 7 middle horizontal
rect(20+gape2,80,10,50); // segment 6 bottom left
rect(80+gape2,80,10,50); // segment 4 bottom right
rect(30+gape2,130,50,10); // segment 5 bottm horizontal
}
public void Num9(){
rect(20+gape,20,10,50); // segment 1 top left vertical
rect(30+gape,10,50,10); // segment 2 top horizontal
rect(80+gape,20,10,50); // segment 3 top right vertical
rect(30+gape,70,50,10); // segment 7 middle horizontal
rect(80+gape,80,10,50); // segment 4 bottom right
rect(30+gape,130,50,10); // segment 5 bottm horizontal

rect(20+gape2,20,10,50); // segment 1 top left vertical
rect(30+gape2,10,50,10); // segment 2 top horizontal
rect(80+gape2,20,10,50); // segment 3 top right vertical
rect(30+gape2,70,50,10); // segment 7 middle horizontal
rect(80+gape2,80,10,50); // segment 4 bottom right
rect(30+gape2,130,50,10); // segment 5 bottm horizontal
}

}
public class SegmentsSec extends SegmentsMnt {

int gape = 130;
int gape2 = 210;
int gape3 = 350;
int gape4 = 430;
public void Num0(){
rect(20+gape3,20,10,50); // segment 1 top left vertical
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(80+gape3,20,10,50); // segment 3 top right vertical
rect(20+gape3,80,10,50); // segment 6 bottom left
rect(80+gape3,80,10,50); // segment 4 bottom right
rect(30+gape3,130,50,10); // segment 5 bottm horizontal


rect(20+gape4,20,10,50); // segment 1 top left vertical
rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(80+gape4,20,10,50); // segment 3 top right vertical
rect(20+gape4,80,10,50); // segment 6 bottom left
rect(80+gape4,80,10,50); // segment 4 bottom right
rect(30+gape4,130,50,10); // segment 5 bottm horizontal
}


public void Num1(){ // Number 1
rect(20+gape3,20,10,50); // segment 1 top left vertical
rect(20+gape3,80,10,50); // segment 6 bottom left

rect(20+gape4,20,10,50); // segment 1 top left vertical
rect(20+gape4,80,10,50); // segment 6 bottom left
}
public void Num2(){
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(80+gape3,20,10,50); // segment 3 top right vertical
rect(30+gape3,70,50,10); // segment 7 middle horizontal
rect(20+gape3,80,10,50); // segment 6 bottom left
rect(30+gape3,130,50,10); // segment 5 bottm horizontal

rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(80+gape4,20,10,50); // segment 3 top right vertical
rect(30+gape4,70,50,10); // segment 7 middle horizontal
rect(20+gape4,80,10,50); // segment 6 bottom left
rect(30+gape4,130,50,10); // segment 5 bottm horizontal
}
public void Num3(){
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(80+gape3,20,10,50); // segment 3 top right vertical
rect(30+gape3,70,50,10); // segment 7 middle horizontal
rect(80+gape3,80,10,50); // segment 4 bottom right
rect(30+gape3,130,50,10); // segment 5 bottm horizontal

rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(80+gape4,20,10,50); // segment 3 top right vertical
rect(30+gape4,70,50,10); // segment 7 middle horizontal
rect(80+gape4,80,10,50); // segment 4 bottom right
rect(30+gape4,130,50,10); // segment 5 bottm horizontal
}
public void Num4(){
rect(20+gape3,20,10,50); // segment 1 top left vertical
rect(30+gape3,70,50,10); // segment 7 middle horizontal
rect(80+gape3,20,10,50); // segment 3 top right vertical
rect(80+gape3,80,10,50); // segment 4 bottom right

rect(20+gape4,20,10,50); // segment 1 top left vertical
rect(30+gape4,70,50,10); // segment 7 middle horizontal
rect(80+gape4,20,10,50); // segment 3 top right vertical
rect(80+gape4,80,10,50); // segment 4 bottom right

}
public void Num5(){
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(20+gape3,20,10,50); // segment 1 top left vertical
rect(30+gape3,70,50,10); // segment 7 middle horizontal
rect(80+gape3,80,10,50); // segment 4 bottom right
rect(30+gape3,130,50,10); // segment 5 bottm horizontal

rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(20+gape4,20,10,50); // segment 1 top left vertical
rect(30+gape4,70,50,10); // segment 7 middle horizontal
rect(80+gape4,80,10,50); // segment 4 bottom right
rect(30+gape4,130,50,10); // segment 5 bottm horizontal


}
public void Num6(){
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(20+gape3,20,10,50); // segment 1 top left vertical
rect(30+gape3,70,50,10); // segment 7 middle horizontal
rect(80+gape3,80,10,50); // segment 4 bottom right
rect(30+gape3,130,50,10); // segment 5 bottm horizontal
rect(20+gape3,80,10,50); // segment 6 bottom left

rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(20+gape4,20,10,50); // segment 1 top left vertical
rect(30+gape4,70,50,10); // segment 7 middle horizontal
rect(80+gape4,80,10,50); // segment 4 bottom right
rect(30+gape4,130,50,10); // segment 5 bottm horizontal
rect(20+gape4,80,10,50); // segment 6 bottom left

}
public void Num7(){
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(80+gape3,20,10,50); // segment 3 top right vertical
rect(80+gape3,80,10,50); // segment 4 bottom right

rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(80+gape4,20,10,50); // segment 3 top right vertical
rect(80+gape4,80,10,50); // segment 4 bottom right
}
public void Num8(){
rect(20+gape3,20,10,50); // segment 1 top left vertical
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(80+gape3,20,10,50); // segment 3 top right vertical
rect(30+gape3,70,50,10); // segment 7 middle horizontal
rect(20+gape3,80,10,50); // segment 6 bottom left
rect(80+gape3,80,10,50); // segment 4 bottom right
rect(30+gape3,130,50,10); // segment 5 bottm horizontal

rect(20+gape4,20,10,50); // segment 1 top left vertical
rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(80+gape4,20,10,50); // segment 3 top right vertical
rect(30+gape4,70,50,10); // segment 7 middle horizontal
rect(20+gape4,80,10,50); // segment 6 bottom left
rect(80+gape4,80,10,50); // segment 4 bottom right
rect(30+gape4,130,50,10); // segment 5 bottm horizontal
}
public void Num9(){
rect(20+gape3,20,10,50); // segment 1 top left vertical
rect(30+gape3,10,50,10); // segment 2 top horizontal
rect(80+gape3,20,10,50); // segment 3 top right vertical
rect(30+gape3,70,50,10); // segment 7 middle horizontal
rect(80+gape3,80,10,50); // segment 4 bottom right
rect(30+gape3,130,50,10); // segment 5 bottm horizontal

rect(20+gape4,20,10,50); // segment 1 top left vertical
rect(30+gape4,10,50,10); // segment 2 top horizontal
rect(80+gape4,20,10,50); // segment 3 top right vertical
rect(30+gape4,70,50,10); // segment 7 middle horizontal
rect(80+gape4,80,10,50); // segment 4 bottom right
rect(30+gape4,130,50,10); // segment 5 bottm horizontal
}

}

No comments:

Post a Comment