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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: A game to pick a favorite from a list

1 点作者 yashg大约 1 年前
Sunday morning programming fun. Created a little game to compare items from a list head-to-head and pick a winner. Inspired from social media short videos where people choose their favourite food, song, holiday destination etc. There are some example lists of cities, movies, actors, fragrances etc to play with and you can create your own list of items and play.<p>Check it out - <a href="https:&#x2F;&#x2F;yash.info&#x2F;head-to-head.html" rel="nofollow">https:&#x2F;&#x2F;yash.info&#x2F;head-to-head.html</a><p>I created it mainly to pick a favourite fragrance from my collection of 50+. Not only is a fun project to build but it also allows me to use some of the interesting libraries and code snippets I find.<p>Programming logic wise there’s nothing fancy happening here, just picking a random element from an array and doing some JS and CSS around that.<p>New thing that I got to learn was generating a random color of a specific type (pastel, fluorescent, light) by playing with HSL values in a specific range instead of the RGB.<p>Discovered <a href="https:&#x2F;&#x2F;arraythis.com" rel="nofollow">https:&#x2F;&#x2F;arraythis.com</a> to convert a list to a JS array.<p>Used SweetAlert <a href="https:&#x2F;&#x2F;sweetalert.js.org" rel="nofollow">https:&#x2F;&#x2F;sweetalert.js.org</a> for alert messages.<p>Been coding for 20+ years and such little projects still give me the joy of creation plus you always learn&#x2F;find something that you did not know yesterday.

3 条评论

jones1618大约 1 年前
It seems like once you favor one choice (&quot;Star Wars&quot; in movies, for example) a couple of times, it only lets you compare other movies to Star Wars.<p>I agree with latexr that for almost every use-case you want this to behave like a bracket that presents a rank of your choices at the end.<p>Before my boys were born I wrote something similar to help us decide baby names. I put all of my wife&#x27;s and my choices in a head-to-head arena in a bunch of rounds. They all started out with a base 50 out of 100 score and the winner of each round got bumped up to the loser&#x27;s cumulative score (if higher) plus some. The loser got bumped down to the winner&#x27;s score (if lower) minus some.<p>The game would stop when all names had competed at least 3 times and scores stopped changing much.<p>I then took my wife&#x27;s top 10 and my top 10 ran the game again on the smaller combined list. It worked really well, especially helping to resolve the &quot;My favorite is X but yours is Y. You suck&quot; logjam. We could see our favorites overlapped a lot which made it easier to agree on a mutually acceptable choice.
latexr大约 1 年前
It would be interesting to end up with a ranked list instead of just the top spot.
评论 #40272487 未加载
gus_massa大约 1 年前
About the first one:<p>It would be nice (or not) that the app retries the options, like a looser bracket in a elimination championship. In case people is in doubt.<p>It would be nice that people can share links with custom lists (but prepare to get spam and nasty lists).
评论 #40272478 未加载