-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
49 lines (38 loc) · 785 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main
import (
"fmt"
"time"
"github.com/inancgumus/screen"
)
func main() {
screen.Clear()
for {
screen.MoveTopLeft()
now := time.Now()
hour, min, sec := now.Hour(), now.Minute(), now.Second()
clock := [...]placeholder{
digits[hour/10], digits[hour%10],
colon,
digits[min/10], digits[min%10],
colon,
digits[sec/10], digits[sec%10],
}
fmt.Printf("hour: %d, min: %d, sec %d\n", hour, min, sec)
for line := range clock[0] {
// For Alarming Every 10 second
//if sec%10 == 0 {
// clock = alarm
//}
for index, digit := range clock {
next := clock[index][line]
if digit == colon && sec%2 == 0 {
next = " "
}
fmt.Print(next, " ")
}
fmt.Println()
}
fmt.Println()
time.Sleep(time.Second)
}
}