In a late Egyptian myth, the sungod Re dreams that one of his grandchildren would usurp his throne, so he forbids his daughter Nut (pronounced "noot") from giving birth on "any day of the year". Nut went to Thoth, the god of wisdom, who created amulets and law and writing, and begged him to help her. Being a clever fellow, Thoth gathered up some honey and beer, and went to see Khonsu, the god of the moon.
They played senet (often called draughts) long into the night, and with each game the ante went up a little more until all Knonsu had to bet was his light, and when Thoth had enough light to make five whole days, the games ended. Nut had her days outside the year during which she could give birth, and Khonsu no longer shone full and bright every night.
It was in this way that the Egyptians explained the leap year, and also why the moon waxes and wanes.