Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Draw-a-clock/Processing/draw-a-clock-1.processing
Normal file
19
Task/Draw-a-clock/Processing/draw-a-clock-1.processing
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
void draw() {
|
||||
drawClock();
|
||||
}
|
||||
void drawClock() {
|
||||
background(192);
|
||||
translate(width/2, height/2);
|
||||
float s = second() * TWO_PI / 60.0;
|
||||
float m = minute() * TWO_PI / 60.0;
|
||||
float h = hour() * TWO_PI / 12.0;
|
||||
rotate(s);
|
||||
strokeWeight(1);
|
||||
line(0, 0, 0, -width*0.5);
|
||||
rotate(-s+m);
|
||||
strokeWeight(2);
|
||||
line(0, 0, 0, -width*0.4);
|
||||
rotate(-m+h);
|
||||
strokeWeight(4);
|
||||
line(0, 0, 0, -width*0.2);
|
||||
}
|
||||
7
Task/Draw-a-clock/Processing/draw-a-clock-2.processing
Normal file
7
Task/Draw-a-clock/Processing/draw-a-clock-2.processing
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
int lastSec = second();
|
||||
void draw() {
|
||||
if (lastSec!=second()) {
|
||||
drawClock();
|
||||
lastSec=second();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue