[jdc] 21-oct-2008 A Tcl solution to http://codegolf.com/saving-time ====== set O {1 7 16 25 34 43 46 40 31 22 13 4} set C {8 o \n 4 o {} 7 o \n 0 {} \n 1 o {} 13 o \n 0 {} \n 0 o {} 15 o \n 0 {} \n 1 o {} 13 o \n 0 {} \n 4 o {} 7 o \n 8 o \n} foreach t $argv { if {[regexp {0?(\d+):0?(\d+)} $t -> h m]} { set h [lindex $O [expr {($h%12)}]] set m [lindex $O [expr {($m/5)}]] if {$m==$h} { set c [lreplace $C $m $m x] } else { set c [lreplace $C $h $h h] set c [lreplace $c $m $m m] } foreach {s o b} $c { puts -nonewline [string repeat " " $s]$o$b } } } ====== Example output: ====== % tclsh w.tcl 21:35 o o o o o h o o o m o o ====== ---- [DKF]: This can be shortened to: ====== set tcl_interactive 1 set O {1 7 16 25 34 43 46 40 31 22 13 4} set C {8 o \n 4 o {} 7 o \n 0 {} \n 1 o {} 13 o \n 0 {} \n 0 o {} 15 o \n 0 {} \n 1 o {} 13 o \n 0 {} \n 4 o {} 7 o \n 8 o \n} sc [ge stdin] %d:%d h m set h [lind $O [exp $h%12]] set m [lind $O [exp $m/5]] fore {s o b} [if $m==$h {lrepl $C $m $m x} {lrepl [lrepl $C $h $h h] $m $m m}] {pu -nonewline [st repe \ $s]$o$b} ====== (Note that the actual problem calls for the time to be suppled on [stdin], not the command line.) ---- !!!!!! %| enter categories here |% !!!!!!