Last active
August 29, 2015 14:07
-
-
Save kureikei/7f288f1d0d655ffb5860 to your computer and use it in GitHub Desktop.
#petitcom (Zeller's congruence: http://d.hatena.ne.jp/eidaht/20130421/1366505255)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DTREAD(DATE$),Y,M,D | |
FOR I=1 TO M | |
READ C | |
NEXT | |
IF M==2 AND (Y%400==0 OR Y%4==0 AND Y%100!=0) THEN C=C+1 | |
IF M<3 THEN Y=Y-1:M=M+12 | |
W=(Y+(0OR Y/4)-(0OR Y/100)+(0OR Y/400)+(0OR(13*M+8)/5)+1)%7 | |
FOR I=1 TO W | |
PRINT " "; | |
NEXT | |
FOR I=1 TO C | |
PRINT RIGHT$(" "+STR$(i),2)" "; | |
IF (I+W)%7==0 THEN PRINT | |
NEXT | |
DATA 31,28,31,30,31,30,31,31,30,31,30,31 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment