How to build a time of day clock on the Commodore 64

Published: March 28, 2018, 1:58 p.m.

b'
\\nIn this video I’ll demonstrate how to build a simple clock on the C64. We’ll go through this process step by step, including the built-in TI and TI$ variables, string formatting with LEFT$, RIGHT$ and MID$, as well as screen formatting.
\\nHere’s the code I’m writing – works in Commodore BASIC v2 and above:
\\n5 input "qwhat is the current time (hhmm
\\nss) ";ti$
\\n10 print chr$(147):print chr$(5)
\\n20 a$ = left$(ti$,2)
\\n25 a$ = a$ +":"
\\n30 a$ = a$ + mid$(ti$,3,2)
\\n35 a$ = a$ +":"
\\n40 a$ = a$ +right$(ti$,2)
\\n50 gosub 200
\\n60 print chr$(19)
\\n70 print "qqqqqqqqqqq]]]]]]]]]]]]]]curre
\\nnt time"
\\n80 print "]]]]]]]]]]]]]]]]";
\\n90 print a$
\\n100 goto 20
\\n200 rem print a box
\\n210 print chr$(19)
\\n220 print "qqqqqqqqqq]]]]]]]]]]]]]UCCCCC
\\nCCCCCCCI"
\\n230 print "]]]]]]]]]]]]]B]]]]]]]]]]]]B"
\\n240 print "]]]]]]]]]]]]]B]]]]]]]]]]]]B"
\\n250 print "]]]]]]]]]]]]]JCCCCCCCCCCCCK"
\\n299 return
\\nMany of the characters that appear in this listing are cursor control characters and appear in reverse in the video. They either position the cursor or print PETSCII graphics.
\\nInspired by David’s video, in which he connects an LCD screen to his C64’s User Port: https://www.youtube.com/watch?v=vV8FbwobrKY
'