Skip to content

Commit 262c305

Browse files
authored
reference: Add time (#202)
* reference: Add day1 Signed-off-by: Ce Gao <[email protected]> * reference: Add hour Signed-off-by: Ce Gao <[email protected]> * reference: Add millis Signed-off-by: Ce Gao <[email protected]> * reference: Add time Signed-off-by: Ce Gao <[email protected]>
1 parent 41050bf commit 262c305

File tree

7 files changed

+54
-0
lines changed

7 files changed

+54
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
d = day() # Values from 1 - 31
2+
m = month() # Values from 1 - 12
3+
y = year() # 2003, 2004, 2005, etc.
4+
5+
text(toString(d), 10, 28)
6+
text(toString(m), 10, 56)
7+
text(toString(y), 10, 84)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
draw <- function() {
2+
background(204)
3+
s = second() # Values from 0 - 59
4+
m = minute() # Values from 0 - 59
5+
h = hour() # Values from 0 - 23
6+
line(s, 0, s, 33)
7+
line(m, 33, m, 66)
8+
line(h, 66, h, 100)
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
draw <- function() {
2+
m = millis()
3+
noStroke()
4+
fill(m%%255)
5+
rect(25, 25, 50, 50)
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
draw <- function() {
2+
background(204)
3+
s = second() # Values from 0 - 59
4+
m = minute() # Values from 0 - 59
5+
h = hour() # Values from 0 - 23
6+
line(s, 0, s, 33)
7+
line(m, 33, m, 66)
8+
line(h, 66, h, 100)
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
d = day() # Values from 1 - 31
2+
m = month() # Values from 1 - 12
3+
y = year() # 2003, 2004, 2005, etc.
4+
5+
text(toString(d), 10, 28)
6+
text(toString(m), 10, 56)
7+
text(toString(y), 10, 84)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
draw <- function() {
2+
background(204)
3+
s = second() # Values from 0 - 59
4+
m = minute() # Values from 0 - 59
5+
h = hour() # Values from 0 - 23
6+
line(s, 0, s, 33)
7+
line(m, 33, m, 66)
8+
line(h, 66, h, 100)
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
d = day() # Values from 1 - 31
2+
m = month() # Values from 1 - 12
3+
y = year() # 2003, 2004, 2005, etc.
4+
5+
text(toString(d), 10, 28)
6+
text(toString(m), 10, 56)
7+
text(toString(y), 10, 84)

0 commit comments

Comments
 (0)