catseye / FBBI

MIRROR of https://codeberg.org/catseye/FBBI : The Flaming Bovine Befunge-98 Interpreter.
https://catseye.tc/node/FBBI
Other
4 stars 1 forks source link

The month returned by the Get SysInfo command is off by 1 #5

Open j4james opened 7 years ago

j4james commented 7 years ago

In the Get SysInfo command, the documentation for the current date just says it should return:

((year - 1900) * 256 * 256) + (month * 256) + (day of month)

It doesn't explicitly declare the range of the month and day of month fields, but I think most people would assume a month in the range 1 to 12, and a day of month in the range 1 to 31, unless specified otherwise.

However, it appears that FBBI is returning the month in the range 0 to 11. Looking at the code, my impression is it's just using what the C stdlib tm_mon field returns, and wasn't actually a conscious decision. So I may be wrong, but I'm assuming this is a bug.

It's also worth mentioning that every other Befunge-98 interpreter I've tested* has gone with a month range of 1 to 12, so FBBI certainly appears to be the odd one out in this regard.

[*] I've tried CCBI, Fungi, PyFunge, cfunge, and Rc/Funge.