Perpetual Calendar 2068

Developer(s): Imre Auersbacher
Date: 1985
Type: Program
Platform(s): TS 2068

Content

Related Products

Related Content

Image Gallery

Source Code

2 REM Perpetual Calendar 2068 4 REM \* 1984 I. Auersbacher 8 BORDER 5: DIM M$(12,9) 10 CLS : PRINT PAPER 6;"*** CALENDAR (1583-9999 AD) *** " 15 LET Z$=" 1 2 3 4 5 6 7 8 910111213141516171819202122232425262728293031": BEEP 0.05,20 20 INPUT "MONTH (1-12):";A: IF (A<1)+(A>12) THEN GO TO 20 30 INPUT "YEAR (YYYY):";B: IF B<1582 THEN BEEP 1,-20: GO TO 30 60 LET B=INT B: LET E=B-(A<3) 65 LET C=A+12*(A<3)+1 70 LET D=INT (E/400)-INT (E/100)+INT (1.25*E)+INT (2.6*C) 75 LET D=D-(7*INT (D/7))+1 80 IF (A=4)+(A=6)+(A=9)+(A=11) THEN LET C=30 85 IF (A=1)+(A=3)+(A=5)+(A=7)+(A=8)+(A=10)+(A=12) THEN LET C=31 90 IF A<>2 THEN GO TO 200 100 LET C=28: IF (B/4=INT (B/4))*(B/100<>INT (B/100))+(B/400=INT (B/400)) THEN LET C=29 200 PLOT 10,132: DRAW 225,0: DRAW 0,-112: DRAW -225,0: DRAW 0,112 210 PLOT 10,118: DRAW 225,0 220 PRINT AT 6,3;"S M T W Th F S": PRINT AT 3,0; 230 FOR Z=1 TO 6: PLOT 10,116-(Z-1)*16: DRAW 225,0: NEXT Z 240 FOR Z=1 TO 6: PLOT 40+(Z-1)*32,132: DRAW 0,-112: NEXT Z 250 RESTORE : FOR Z=1 TO 12: READ M$(Z): NEXT Z 252 PRINT TAB 8;M$(A);TAB 18;B 264 DIM C$(74): LET J=8: LET K=2: LET C$=C$( TO 2*D-2)+Z$ 270 FOR Z=1 TO C+D-1: PRINT AT J,K;C$(2*Z-1 TO 2*Z): LET K=K+4 280 IF (Z/7=INT (Z/7)) THEN LET J=J+2: LET K=2 290 NEXT Z: STOP : STOP 300 DATA "JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER" 999 SAVE "cal" LINE 8