Big digit clock (batch)

August 22, 2009 at 19:59:25
Specs: Windows XP Pro SP3
A simple clock in big digits:
(the blinking effect could be avoided if there was an echo replacement that could define screen coordinates. So for each change, the date string could be merely overwritten, avoiding the cls command)

echo off
color 09
setlocal enabledelayedexpansion
set s1=ÛßÛ ÜÛ -ßßÛ ßßÛ Û Û Ûßß Ûßß ßßÛ ÛßÛ ÛßÛ
set s2=Û Û- Û -Ûßß ßßÛ ßßÛ ßßÛ ÛßÛ-- Û ÛßÛ ßßÛ
set s3=ßßß ßßß ßßß ßßß-- ß ßßß ßßß-- ß ßßß ßßß
::-----012345678901234567890123456789012345678
:loop
cls
echo.
for /f "tokens=1" %%u in ('echo %time%') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set tim=%t:~0,2%%t:~3,2%%t:~6,2%
set t1=!tim:~0,1!
set t2=!tim:~1,1!
set t3=!tim:~2,1!
set t4=!tim:~3,1!
set t5=!tim:~4,1!
set t6=!tim:~5,1!
:line1
set /a pos=4*!t1!
set x1=!s1:~%pos%,3!
set /a pos=4*!t2!
set x2=!s1:~%pos%,3!
set /a pos=4*!t3!
set x3=!s1:~%pos%,3!
set /a pos=4*!t4!
set x4=!s1:~%pos%,3!
set /a pos=4*!t5!
set x5=!s1:~%pos%,3!
set /a pos=4*!t6!
set x6=!s1:~%pos%,3!
echo %x1% %x2% Ü %x3% %x4% Ü %x5% %x6%
::line2
set /a pos=4*!t1!
set x1=!s2:~%pos%,3!
set /a pos=4*!t2!
set x2=!s2:~%pos%,3!
set /a pos=4*!t3!
set x3=!s2:~%pos%,3!
set /a pos=4*!t4!
set x4=!s2:~%pos%,3!
set /a pos=4*!t5!
set x5=!s2:~%pos%,3!
set /a pos=4*!t6!
set x6=!s2:~%pos%,3!
echo %x1% %x2% - %x3% %x4% - %x5% %x6%
:line3
set /a pos=4*!t1!
set x1=!s3:~%pos%,3!
set /a pos=4*!t2!
set x2=!s3:~%pos%,3!
set /a pos=4*!t3!
set x3=!s3:~%pos%,3!
set /a pos=4*!t4!
set x4=!s3:~%pos%,3!
set /a pos=4*!t5!
set x5=!s3:~%pos%,3!
set /a pos=4*!t6!
set x6=!s3:~%pos%,3!
echo %x1% %x2% ß %x3% %x4% ß %x5% %x6%
:wait
for /f "tokens=1" %%u in ('echo %time%') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set tim2=%t:~0,2%%t:~3,2%%t:~6,2%
if %tim2%==%tim% goto :wait
goto :loop


See More: Big digit clock (batch)

Report •


#1
August 23, 2009 at 16:12:58
the blinking effect could be avoided if there was an echo replacement that could define screen coordinates.
You'd have to write one in C/C++. The hardest part would be the text parsing, honestly.

Report •
Related Solutions


Ask Question