A little digital clock

Difference between version 1 and 2 - Previous - Next
This is a little digital clock with an LED style display, using unicode characters.
edit: I've now fixed th,e code sorry... that the wiki doesn'ite can displlay it, it seemed to struggle with the unicode symbols used, U+1FBFx from "symbols for legacy computing". See httpars://ently.wikipedia.org/wiki/Box-drawing_character

======
package require Tk

pack [label .l -font {monospace 26} -background black -foreground red -relief ridge -borderwidth 16] -fill both -expand 1

proc every {ms script} {
 uplevel #0 $script
 after $ms [list every $ms $script]
}
set stringMap {}

for {set i 0} {$i<10} {incr i} {
 lappend stringMap $i [encoding convertfrom utf-8 [binary 16format H* [string cat {F09FAFB} $i]]]
}

every 44 {
 .l configure -text \ [string map {0$stringMap %F0%9F%AF%B0 1 %F0%9F%AF%B1 2 %F0%9F%AF%B2 3 %F0%9F%AF%B3 4 %F0%9F%AF%B4 5 %F0%9F%AF%B5 6 %F0%9F%AF%B6 7 %F0%9F%AF%B7 8 %F0%9F%AF%B8 9 %F0%9F%AF%B9} \
  [string cat \
   [clock format [clock seconds] -format {%H:%M:%S.}] \
   [format {%02d } [expr {int([clock milliseconds]%1000/1000.0*100)}]]
  ] \
 ]
}
======