TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Low Tech Secret Santa

16 点作者 xept超过 3 年前

6 条评论

tshaddox超过 3 年前
I think I’m missing some implicit constraints here. Firstly, I guess they’re assuming that the person organizing the event also wants to participate, or at least doesn’t want to know the pairings. But even then, couldn’t you just shuffle the names once and pair everyone with the next name in the list (wrapping around from that last to the first)? Is that not supposed to be “random” enough? You could also just write a simple program to shuffle the names until you get valid pairings and print or otherwise send the pairings without looking at them. What am I missing?
评论 #29527273 未加载
jcul超过 3 年前
For the past few years I&#x27;ve used a simple python script + twilio to send a SMS text to family for secret Santa.<p>It works surprisingly well, for dry runs &#x2F; debugging I print out the random pairings, but for the real one I just output nothing and send the texts.<p>Of course, I could go and check the twilio logs and find out who has who, but that would ruin the fun.<p>I don&#x27;t go so far as to try ensure that previous years don&#x27;t match with the same person. You wouldn&#x27;t have that guarantee if pulling names out of a hat in person.
vitus超过 3 年前
In case anyone&#x27;s wondering about the value of p converging &quot;somewhere above 1&#x2F;3&quot; and doesn&#x27;t want to wait for the next installment, it converges to 1&#x2F;e.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Derangement#Growth_of_number_of_derangements_as_n_approaches_%E2%88%9E" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Derangement#Growth_of_number_o...</a>
_6sik超过 3 年前
The part that is - surprisingly computationally complicated - and I can&#x27;t stress this enough, is ensuring that previous years&#x27; matches don&#x27;t re-match. When you add more people and more years, it turns into a bloody mess to a point of engines throwing hissy fits. Run the numbers, be surprised.
doublepg23超过 3 年前
All my friends use Telegram and this bot was very helpful for Secret Santa. <a href="https:&#x2F;&#x2F;github.com&#x2F;Voxter256&#x2F;Secret-Santa-Bot" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Voxter256&#x2F;Secret-Santa-Bot</a> (Currently running in Docker on a Beagle Bone Black!)
baud147258超过 3 年前
or the person organising the secret santa could do the draw themselves, check that no one is going to give a gift to themselves and they&#x27;re good to go. It just requires that someone knows the pairings, but that&#x27;s an easier solution.
评论 #29527173 未加载