New Year's draw

    You see, every year on December 31, my friends and I give presents. We have such a tradition ...

    It is not always known in advance who will come to the New Year's party, how many guests will be and who they will be. In the circle of my friends, this situation repeated itself from year to year.

    There may not be enough gifts for everyone, therefore, so as not to offend anyone, once we decided that everyone would grab one “public” gift. And on the spot we’ll decide who gives whom to whom and what.

    There were always those who brought as a souvenir a mirror, lipstick, chess. That is, gifts, with a predetermined set of possible recipients. Couples who came for the holiday did not want to give this gift to each other, because they knew in advance what they had prepared.

    Each time, I sat down and wrote a script on my knee to select random pairs of donors and recipients. And every time he, the script, was lost the next year. But at the same time a new, more perfect one appeared. It became more complicated, wallpapers, snowflakes and other beauty appeared.

    And then one day they got around to perpetuate the accumulated experience in the field of the “New Year rally” in the form of an html page, which I want to share with you: .

    There is almost nothing unusual in the page itself, html + javascript. There is an English version. It was created a couple of evenings, so do not scold too much. To find pairs, a randomized depth search is used. There is a problem with the search execution time with a large number of restrictions. If someone has good hands, I will be glad to commit.

    For the page to start, just download the repository and run index.html.

    Quite a bit of time is left before the New Year, Catholic Christmas is coming, the Orthodox are warming up, and the old New Year is hanging up. I hope that someone will find this New Year’s website useful.

    All with the coming!

    Also popular now: