2005-02-18 19:09:24 -05:00
|
|
|
USING: vectors kernel math stdio strings ;
|
|
|
|
|
|
|
|
: lcd-digit ( digit row -- str )
|
|
|
|
{
|
|
|
|
" _ _ _ _ _ _ _ _ "
|
|
|
|
" | | | _| _| |_| |_ |_ | |_| |_| "
|
|
|
|
" |_| | |_ _| | _| |_| | |_| | "
|
|
|
|
} vector-nth >r 4 * dup 4 + r> substring ;
|
|
|
|
|
|
|
|
: lcd-row ( num row -- )
|
2005-03-05 16:33:40 -05:00
|
|
|
swap [ CHAR: 0 - over lcd-digit write ] string-each drop ;
|
2005-02-18 19:09:24 -05:00
|
|
|
|
|
|
|
: lcd ( num -- str )
|
|
|
|
3 [ 2dup lcd-row terpri ] repeat drop ;
|