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

    From Janis Papanagnou@21:1/5 to All on Mon Nov 7 18:24:31 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pat Rankin@21:1/5 to Janis Papanagnou on Tue Nov 8 11:37:39 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Pat Rankin on Tue Nov 8 22:08:36 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)