--- title: "Perpetual Calendar" type: "article" slug: "perpetual-calendar-2" url: "http://localhost/article/perpetual-calendar-2/" markdown_url: "http://localhost/article/perpetual-calendar-2.md" published_at: "2022-10-07T12:28:11+00:00" modified_at: "2024-06-11T13:57:09+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" category: - name: "The RAMTOP" slug: "the-ramtop" taxonomy: "category" url: "http://localhost/category/periodicals/the-ramtop/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Imre Auersbacher" slug: "imre-auersbacher" taxonomy: "indiv" url: "http://localhost/indiv/imre-auersbacher/" publication_r: id: 39272 title: "The RAMTOP" type: "periodical" url: "http://localhost/periodical/the-ramtop/" authors: "Imre Auersbacher" issues_articles: - id: 39860 title: "The RAMTOP Aug 1986" type: "issue" url: "http://localhost/issue/the-ramtop-aug-1986/" pages: "4" pubdate: "August 1986" archive_link: false article_media: - id: 55039 title: "Perpetual Calendar 2068" type: "computer_media" url: "http://localhost/computer_media/perpetual-calendar-2068/" --- # Perpetual Calendar ## Source Code: Perpetual Calendar 2068 ``` 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 ```