5 Cent tip for today [ clock ticks ]

Started by newdep, July 19, 2004, 07:01:16 AM

Previous topic - Next topic

newdep

;;

;;

;; Newlisp clocking

;;

;; linux version or dos-box with ansi support.

;; enjoy...norman.

;;



(set 'digits '(

("#####" "  #  " "#####" "#####" "#   #" "#####" "#    " "#####" "#####" "#####" "     ")

("#   #" "  #  " "    #" "    #" "#   #" "#    " "#    " "    #" "#   #" "#   #" "  #  ")

("#   #" "  #  " "#####" "#####" "#####" "#####" "#####" "    #" "#####" "#####" "     ")

("#   #" "  #  " "#    " "    #" "    #" "    #" "#   #" "    #" "#   #" "    #" "  #  ")

("#####" "  #  " "#####" "#####" "    #" "#####" "#####" "    #" "#####" "    #" "     ")))





(while true

 ;; clear screen ANSI way

 (println "27[H27[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))