proc crt_cls { sck } { puts -nonewline $sck "\33\[1;1H\33\[2J" } proc crt_gotoXY { sck scrX scrY } { puts -nonewline $sck "\33\[$scrY;$scrX\H" } proc crt_setColor { sck bg fg } { set cols [list "0" "4" "2" "6" "1" "5" "3" "7"] puts -nonewline $sck "\33\[0;" if { $bg > 7 } { puts -nonewline $sck "5;" incr bg -8 } if { $fg > 7 } { puts -nonewline $sck "1;" incr fg -8 } puts -nonewline $sck "4[lindex $cols $bg];" puts -nonewline $sck "3[lindex $cols $fg]m" }