home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / genie-commodore-file-library / C64Software / CALENDAR-CLOCK (.txt) < prev    next >
Commodore BASIC  |  2019-04-13  |  4KB  |  117 lines

  1. 0 LI$="........................................":DN$=""
  2. 1 POKE53281,0:POKE53280,0:POKE646,1:GOSUB108
  3. 2 INPUT"YEAR";CY:INPUT"MONTH";MO:INPUT"DAY";DA:
  4. 3 PRINTCHR$(142):XE=54272:GOTO10
  5. 4 FORL=0TO24:POKEXE+L,0:NEXT:K=T1:IFK+T2>30THENK=1
  6. 5 POKEXE+1,117:POKEXE+5,12:POKEXE+15,12:POKEXE+24,15
  7. 6 FORL=1TOK:POKEXE+4,21:TY=TI+120
  8. 7 IFTI<TYTHEN7
  9. 8 POKEXE+4,20:NEXT:RETURN
  10. 9 RETURN
  11. 10 DIMH$(12):FORL=1TO15:A$=".[157]":V$=V$+A$:NEXT:GOSUB77
  12. 11 AM$(0)="[209]AM  PM":AM$(1)=" AM [209]PM"
  13. 12 Y=CY:D=DA
  14. 13 INPUT"DAY OF WEEK SUNDAY=1 1[157][157][157]";DW
  15. 14 XA=165:XF=56331:XG=240:XH=15
  16. 15 MO$="JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC":XK=2:XF=56331:XI=16
  17. 16 MP$="UARRUACH IL    E  Y  USTTEMOBEEMBEMB"
  18. 17 MQ$="Y  RY                   BERR  ER ER "
  19. 18 DM$="312831303130313130313031":S$=""
  20. 19 DATA  060,102,110,118,102,102,060,024,024,056,024,024,024,126,060,102,006
  21. 20 DATA  012,048,096,126,060,102,006,028,006,102,060,006,014,030,102,127,006
  22. 21 DATA  006,126,096,124,006,006,102,060,060,102,096,124,102,102,060,126,102
  23. 22 DATA  012,024,024,024,024,060,102,102,060,102,102,060,060,102,102,062,006
  24. 23 DATA  102,060
  25. 24 PRINT"[147]MAKING BIG DIGITS...STANDBY":GOSUB32
  26. 25 GOSUB54:GOTO40
  27. 26 IFPEEK(XF-3)<>0THEN26
  28. 27 DW=DW+1:IFDW>7THENDW=1
  29. 28 D=D+1:IFD<=DMTHEN31
  30. 29 D=1:MO=MO+1:IFMO<=12THEN31
  31. 30 MO=1:D=1:Y=Y+1
  32. 31 GOSUB55:GOSUB64:RETURN
  33. 32 C1$="[157][157][157][157][157][157][157][157]"
  34. 33 C2$=" [146]"
  35. 34 C$="[145][145][145][145][145][145][145][145]":FORL=0TO9:FORM=0TO6:READA:G$="":FORF=0TO7:B=A/XK
  36. 35 IFB=INT(A/XK)THENG$=" "+G$:GOTO37
  37. 36 G$=C2$+G$
  38. 37 PRINTG$"[145]";:A=INT(A/XK):PRINT"[157][157][157][157][157][157][157][157]":NEXT
  39. 38 H$(L)=H$(L)+G$+C1$:NEXT:PRINT"";:H$(L)=H$(L)+C$:GOSUB115:NEXT:PRINT"[147]"
  40. 39 RETURN
  41. 40 GOSUB64:GOTO42
  42. 41 GOTO91
  43. 42 PRINT""
  44. 43 H=PEEK(XF):M=PEEK(XF-1):T=PEEK(XF-3)
  45. 44 T1=((XIANDH)/XI)*10+((XHANDH))
  46. 45 T2=((XGANDM)/XI)*10+((XHANDM))
  47. 46 IFT2<=59THEN48
  48. 47 IFT1>12THENT1=1
  49. 48 A(2)=(T1-(INT(T1/10)*10)):A(1)=INT(T1/10):A(4)=(T2-(INT(T2/10)*10))
  50. 49 A(3)=INT(T2/10):TM=(T2=30ORT2=0)
  51. 50 IFT1=12THENIFT2=00THENIFP1=0THENIFPEEK(XF)=18THENTI$="000000":FL=0:GOSUB26
  52. 51 PRINT"";:FORL=0TO3:PRINT""TAB(L*8)H$(A(L+1));:NEXT:IFTMTHENGOSUB4
  53. 52 AX=(ABS(VAL(LEFT$(TI$,2))>11)):PRINT""TAB(33)AM$(AX)""                  
  54. 53 GOTO91
  55. 54 POKE646,1
  56. 55 GOSUB103
  57. 56 LD=0:IF(YAND3)THEN58
  58. 57 LD=1:IFY/100=INT(Y/100)THENIFY/400<>INT(Y/400)THENLD=0
  59. 58 MR$=MID$(MO$,MO*3-2,3)
  60. 59 MR$=MR$+MID$(MP$,MO*3-2,3)
  61. 60 MR$=MR$+MID$(MQ$,MO*3-2,3)
  62. 61 DM=VAL(MID$(DM$,MO*2-1,2)):IFDM=28THENDM=DM+LD
  63. 62 GOSUB103:IFDO>=7THENDO=0
  64. 63 RETURN
  65. 64 POKE646,1:PRINT"[147]";TAB(3)MR$;TAB(31);Y:PRINT
  66. 65 PRINT"   SUN  MON  TUE  WED  THU  FRI  SAT":PRINT
  67. 66 FORL=1TODM:IFL=DTHENPRINT"";:DA=DO
  68. 67 DO=DO+1:IFL>9THEN69
  69. 68 PRINTTAB(5*(DO)-2+1)L;:GOTO70
  70. 69 PRINTTAB(5*(DO)-3+1)L;
  71. 70 IFDO=>7THENPRINT:PRINT:DO=0
  72. 71 PRINT"[146]";:NEXT:PRINT:PRINTLI$DN$LI$DN$TAB(0)V$DN$TAB(39)V$DN$"":RETURN
  73. 72 C$=RIGHT$(STR$(100+PEEK(171)),2):REM MONTH
  74. 73 B$=RIGHT$(STR$(100+PEEK(170)),2):REM DATE
  75. 74 A$=RIGHT$(STR$(100+PEEK(172)),2):REM YEAR
  76. 75 RETURN
  77. 76 PRINTH$(10-(LEFT$(TI$,2)>"12"))
  78. 77 PRINT"[147]":A$(1)="  [157] [157] [157] [157][157]   "
  79. 78 A$(2)="   [157] [157][157][157]   [157][157][157] [157]   "
  80. 79 A$(3)="   [157] [157][157][157]   [157] [157][157][157]   "
  81. 80 A$(4)="  [157][157][157]  [157][157][157]   [157] [157] "
  82. 81 A$(6)="   [157][157][157] [157]   [157][157][157]  [157][157][157]   "
  83. 82 A$(5)="   [157][157][157] [157]   [157] [157][157][157]   "
  84. 83 A$(7)="   [157] [157] [157] [157] "
  85. 84 A$(8)="   [157][157][157]  [157][157][157]   [157][157][157]  [157][157][157]   "
  86. 85 A$(9)="   [157][157][157]  [157][157][157]   [157][157][157] [157][157][157]   "
  87. 86 A$(0)="   [157][157][157]  [157][157][157]  [157][157][157]  [157][157][157]   "
  88. 87 A$(10)="[146]   [157][157][157]   [157][157][157]   [157][157][157]   [157][157][157]   "
  89. 88 C$="[145][145][145][145]":E$="":F$=C$+E$
  90. 89 CC$=A$(10)+F$:RETURN
  91. 90 XH=15:XF=56331:REM XI=240
  92. 91 IFPEEK(XF-3)<>0THEN91
  93. 92 SS=PEEK(XF-2):P1=((XGANDSS)/XI)*10+(XHANDSS)
  94. 93 IFVF=0THENVF=1:GOTO96
  95. 94 FL=0
  96. 95 IFINT(P1/10)=INT(P2/10)THEN97
  97. 96 PRINT""SPC(33)CC$;""SPC(33)A$(INT(P1/10))F$;"[146]";
  98. 97 IFP1=0THENFL=1
  99. 98 PRINT""SPC(37)CC$;
  100. 99 PRINT""SPC(37)""A$(P1-(INT(P1/10)*10));"[146]";:IFFL=1THEN42
  101. 100 IFAL$=""THEN102
  102. 101 PRINT""TAB(33)AM$(AX)""
  103. 102 P2=P1:GOTO91
  104. 103 B=DW:X=D:REM   IFX=1THENDO=DW:RETURN
  105. 104 X=X-1
  106. 105 B=B-1:IFB=0THENB=7
  107. 106 IFX>0THEN104
  108. 107 DO=B:RETURN
  109. 108 INPUT" ENTER 24-HOUR TIME (HHMMSS) 235959[157][157][157][157][157][157][157][157]";TI$:PRINT"[147]"
  110. 109 FORI=1TO3:T(I)=10*VAL(MID$(TI$,I+I-1,1))+VAL(MID$(TI$,I+I,1)):NEXT
  111. 110 T(4)=3:IFT(1)>23ORT(2)>59ORT(3)>59THEN108
  112. 111 F=0:IFT(1)>12THENF=128:T(1)=T(1)-12
  113. 112 FORI=1TO3:H=INT(T(I)/10):L=T(I)-10*H:T(I)=16*H+L:NEXT:T(1)=T(1)ORF
  114. 113 C=56331:POKEC+4,PEEK(C+4)AND127
  115. 114 FORI=0TO3:POKEC-I,T(I+1):NEXT:FORI=0TO3:NEXT:RETURN
  116. 115 FORR=1TO8:POKE781,R:SYS59903:NEXT:RETURN
  117.