Hope to clear things up a bit with this Columbus Day demo, but short answer... When was Columbus Day in 1492? No day... It hadn't been invented until 1971.
Anyway, the demo shows all leap years in yellow, non in white. It shows the difference in calendar days for each year, 365 or 366 (except the first year, 1492). What you will notice that unless it is a leap year the progression is the next day each year. On a leap year it skips to the day after next. The pattern proves if the algorithm used is correct.
Pete
Anyway, the demo shows all leap years in yellow, non in white. It shows the difference in calendar days for each year, 365 or 366 (except the first year, 1492). What you will notice that unless it is a leap year the progression is the next day each year. On a leap year it skips to the day after next. The pattern proves if the algorithm used is correct.
Code: (Select All)
' Columbus Day "Day of the Week" from 1492 on...
' Using Gregorian calendar algorithm, which was not available (invented) until 1582.
Width 80, 43
_ScreenMove 0, 0
map$ = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday"
year = 1492
month = 10
Rem January = 0, February = 31,March = 59, April = 90, May = 120, June = 151, July = 181, August = 212,,September = 243, October = 273, November = 304 and December = 334
oct = 273
day = 12
Do
leapyear = 0
ans = (365 * year) + year \ 4 - year \ 100 + year \ 400 - 365
If year Mod 4 = 0 And year Mod 100 Or year Mod 4 = 0 And year Mod 100 = 0 And year Mod 400 = 0 Then leapyear = 1
If leapyear And month < 3 Then ans = ans - 1
ans = ans + oct + day
dow = ans Mod 7
If leapyear Then Color 14 Else Color 7
Print year, ans, ans - oldans, "Oct 12,"; year; "falls on a " + Mid$(map$, 10 * dow + 1, 10)
year = year + 1
oldans = ans
Sleep
Loop
Pete
Shoot first and shoot people who ask questions, later.