On 08.11.2022 20:37, Pat Rankin wrote:
> On Monday, November 7, 2022 at 9:24:35 AM UTC-8, Janis Papanagnou wrote:
>> Is Nethack's three-days lasting full moon _starting_ at real
>> full moon (and ending three day after real full moon), or am I
>> missing something?
>
> The relevant code is phase_of_the_moon() in hacklib.c.
> Good luck making any sense out of it.
I already inspected that code some years ago. _Analytically_
I also cannot derive anything from that formula.
I had also used a Javascript transcription of that formula
for
http://random.gridbug.de/moonphase.html and added a "-1"
correction factor for "Nethack mode" (a click on the header
text toggles modes).
_Empirically_ I did notice last midnight that Nethack claims
new moon _today_. So it *seems* that the day when new moon
is defined in Real Life will start Nethack's new moon phase.
> I can't claim that
> I comprehend it (aside from the pointless optimization
> of '(X) & 7' instead of '(X) % 8' as the final step to yield
> 0..7 for the eight divisions of the month).
I wouldn't even consider that an optimization; it was, maybe,
5 decades ago. :-)
>
> It uses integer arithmetic, making it more complicated
> and conceivably introducing drift cause by accumulated
> round-off error.
I assumed the formula to be correct and was just wondering
about the placement of the 3-4 days interval around the Real
Life new moon.
I also cannot tell anything about wobbling drifts (if any)
or other drifts.
Janis