5 Cent tip for today [ clock ticks ]

Featuring the Dragonfly web framework
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

5 Cent tip for today [ clock ticks ]

Post by newdep »

;;
;;
;; Newlisp clocking
;;
;; linux version or dos-box with ansi support.
;; enjoy...norman.
;;

(set 'digits '(
("#####" " # " "#####" "#####" "# #" "#####" "# " "#####" "#####" "#####" " ")
("# #" " # " " #" " #" "# #" "# " "# " " #" "# #" "# #" " # ")
("# #" " # " "#####" "#####" "#####" "#####" "#####" " #" "#####" "#####" " ")
("# #" " # " "# " " #" " #" " #" "# #" " #" "# #" " #" " # ")
("#####" " # " "#####" "#####" " #" "#####" "#####" " #" "#####" " #" " ")))


(while true
;; clear screen ANSI way
(println "\027[H\027[2J")

;; define time without ":" get from apply date
(set 'ticks (replace ":" (slice (date (apply date-value (now))) 11 8) ""))

;; write 5 rows of 6 digits and 2 seperators
(dotimes (x 5)
(dotimes (y 6)
(print " " (nth (integer (nth 0 (nth y ticks))) (nth x digits)))
(if (or (= y 1) (= y 3)) (print (nth 10 (nth x digits)))))
(println))
(sleep 1)
)
-- (define? (Cornflakes))

Locked