coding-horror / basic-computer-games

An updated version of the classic "Basic Computer Games" book, with well-written examples in a variety of common MEMORY SAFE, SCRIPTING programming languages. See https://coding-horror.github.io/basic-computer-games/
The Unlicense
10.85k stars 1.33k forks source link

95 Weekday: Handles 1582 dates incorrectly #546

Open stevebosman opened 2 years ago

stevebosman commented 2 years ago

The following line in the original code leads to an error if dates before 1582 are supplied (which is fine) 290 IF Y-1582 <0 THEN 1300

However it means the day of week calculation is performed on days in 1582, but before 15 October 1582 (the date the Gregorian calendar started).

I think the test should be changed to check that the supplied date is on or after 15 October 1582.

stevebosman commented 2 years ago

I am currently looking at tidying up the Javascript implementation, but I am unsure whether I should unilaterally fix this on one implementation.

coding-horror commented 2 years ago

sure, if it is a bug in the original code please put a note in the readme.md in the game folder!

coding-horror commented 2 years ago

One of my todo items is to add a "translator / port notes" section to the readme.md of each game..