Author Topic: Little Clock Project 2 (BASIC) - WITHOUT M4 needed !  (Read 629 times)

0 Members and 1 Guest are viewing this topic.

Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 329
  • Country: de
  • Liked: 184
  • Likes Given: 98
Ok, thought I give my Little Clock Project a go and write it for systems without a M4 card and for emulators ...here we are  8)


Code: [Select]
5 d$=":":m$="none"
10 MODE 1
15 INPUT"Date (YYYYMMDD) ";date$
20 INPUT"hour (##)";hour
30 INPUT"minute (##)";minute
40 INPUT"second (##)";second
45 CLS
50 datum=INT(TIME/300)
60 tick=(INT(TIME/300)-datum)+second
70 IF tick=60 THEN tick=0:IF tick=0 THEN second=0:IF second=0 THEN minute=minute+1:datum=INT(TIME/300)
80 IF minute=60 THEN minute=0:IF minute=0 THEN hour=hour+1
90 IF hour=24 THEN hour=0
92 IF hour<10 THEN ho$="0" ELSE ho$=""
93 IF ho$="0" THEN q=1 ELSE q=2
94 IF minute<10 THEN mi$="0" ELSE mi$=""
95 IF mi$="0" THEN u=1 ELSE u=2
96 IF tick<10 THEN ti$="0" ELSE ti$=""
97 IF ti$="0" THEN j=1 ELSE j=2
100 LOCATE 10,10
105 hour$=STR$(hour):minute$=STR$(minute):tick$=STR$(tick):z$=ho$+RIGHT$(hour$,q)+d$+mi$+RIGHT$(minute$,u)+d$+ti$+RIGHT$(tick$,j)
106 v$=LEFT$(z$,5)
107 IF v$=m$ THEN SOUND 1,100,100:SOUND 1,0
110 PRINT z$;" ";LEFT$(date$,4);"-";MID$(date$,5,2);"-";RIGHT$(date$,2)
112 LOCATE 10,12:PRINT"Reminder : ";m$
115 r$=INKEY$:IF r$="r" THEN GOTO 200
120 GOTO 60
200 CLS:LOCATE 10,12:INPUT"Reminder (##:##) ",m$
210 IF m$="" THEN m$="none"
220 CLS:GOTO 60


The date is still static but I'll work on that if I get a good idea how to realize it inside of 1KB ;D
« Last Edit: 00:42, 27 March 21 by SkulleateR »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.783
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3964
  • Likes Given: 7081
Re: Little Clock Project 2 (BASIC) - WITHOUT M4 needed !
« Reply #1 on: 10:02, 29 March 21 »
Finally! A use for my CPC! :D