Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Definition of moon phases (start date of NH full moon)

24 views
Skip to first unread message

Janis Papanagnou

unread,
Nov 7, 2022, 12:24:35 PM11/7/22
to
In Nethack the moon phases are quantified in eight phases, each
phase covering three or four days.

These days real full moon is around Tuesday, 2022-11-08, 12:00.
Having (in Nethack) a period of three days for full moon now my
expectation would be that the Nethack phase would start one day
before real full moon and end one day after real full moon.

(Note: I'm in a central EU time zone but the question is still
valid if we assume, say, UTC+6 or UTC-6.)

If I start NH-343 or Slashem now I don't get the "You're lucky"
full moon message.

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?

Janis

Pat Rankin

unread,
Nov 8, 2022, 2:37:41 PM11/8/22
to
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 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).

It uses integer arithmetic, making it more complicated
and conceivably introducing drift cause by accumulated
round-off error.

Janis Papanagnou

unread,
Nov 8, 2022, 4:08:40 PM11/8/22
to
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

0 new messages