Just for fun
Idea from here: http://codegolf.stackexchange.com/questions/73259/output-the-current-time-in-ascii-art
Edit:
Also added an analogue experimental version in post #11
#include <GUIConstants.au3>
HotKeySet("{ESC}", "End")
Local $hClock, $sDelim = ";", $aChar, $sScanLines, $aScanLine[6], $aFont[13] = [ _
' ___ ; / _ \ ; | | | | ; | | | | ; | |_| | ; \___/ ', _ ; 0
' __ ; /_ | ; | | ; | | ; | | ; |_| ', _ ; 1
' ___ ; |__ \ ; ) | ; / / ; / /_ ; |____| ', _ ; 2
' ____ ; |___ \ ; __) | ; |__ < ; ___) | ; |____/ ', _ ; 3
' _ _ ; | || | ; | || |_ ; |__ _| ; | | ; |_| ', _ ; 4
' _____ ; | ____| ; | |__ ; |___ \ ; ___) | ; |____/ ', _ ; 5
' __ ; / / ; / /_ ; | _ \ ; | (_) | ; \___/ ', _ ; 6
' ______ ; |____ | ; / / ; / / ; / / ; /_/ ', _ ; 7
' ___ ; / _ \ ; | (_) | ; > _ < ; | (_) | ; \___/ ', _ ; 8
' ___ ; / _ \ ; | (_) | ; \__, | ; / / ; /_/ ', _ ; 9
' ; _ ;(_); _ ;(_); ', _ ; :
" ; ; __ _ _ __ ;/ _` | ' \;\__,_|_|_|_|; ", _ ; am
" ; ; _ __ _ __ ;| '_ \ ' \;| .__/_|_|_|;|_|"]; pm
Global $hAsciiClock = GUICreate("Ascii clock", 390, 80, 10, 10, $WS_POPUPWINDOW, BitOR($WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE, $WS_EX_COMPOSITED))
$hClock = GUICtrlCreateLabel("", 0, 0, 390, 80, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetFont(-1, 7, 0, 0, "Courier new")
GUISetState()
While 1
$sTime = StringFormat("%02s", @HOUR - (12 * (@HOUR > 12))) & "A" & @MIN & "A" & @SEC & Hex(11 + Number(@HOUR > 12), 1)
For $x = 1 To StringLen($sTime)
$achar = StringSplit($aFont[Dec(StringMid($sTime, $x, 1))], $sDelim, 3)
For $i = 0 To 5
If $x = StringLen($sTime) Then ; last char (am or pm)
$aScanLine[$i] = StringFormat('%-65s', $aScanLine[$i]) & $achar[$i]
Else
$aScanLine[$i] &= $achar[$i]
EndIf
Next
Next
For $i = 0 To 5
$sScanLines &= $aScanLine[$i] & @CRLF
$aScanLine[$i] = ""
Next
GUICtrlSetData($hClock, $sScanLines)
$sScanLines = ""
Sleep(1000)
WEnd
Func End()
If WinActive("[ACTIVE]") = $hAsciiClock Then Exit
EndFunc ;==>End