I hid bugs in JavaScript on purpose and let strangers find them. There's a live A/B test underneath.
So I’m doing Toggle Wars (the WeMakeDevs x Flagsmith hackathon), and instead of building another todo app with a feature flag slapped on, I built a game where the experiment IS the game. The idea Spot the Bug (https://doomsage.github.io/spot-the-bug/) is a 3-minute quiz. You get real-looking JavaScript snippets, and each one has a bug hiding in it. An off-by-one loop, a var where a let should be, an async function nobody awaited. You click the line you think is broken. Wrong answers cost you, right answers get you streaks. It’s the kind of thing you finish and immediately want to retry because you KNOW you saw that closure bug. I picked bugs that have actually bitten me or people I know, so if you write JS for a living, some of these will feel personal.
我正在参加 Toggle Wars(WeMakeDevs 与 Flagsmith 联合举办的黑客松),我没有选择那种仅仅贴上功能标志(feature flag)的待办事项应用,而是构建了一个以实验本身为核心的游戏。这个名为“找出 Bug”(Spot the Bug)的项目是一个 3 分钟的测验。你会看到看起来很真实的 JavaScript 代码片段,每个片段中都隐藏着一个 Bug。可能是差一错误(off-by-one)的循环、本该用 let 却用了 var 的变量,或者是没人等待的异步函数。你需要点击你认为出错的那一行。答错会扣分,答对则会获得连胜。这是一种让你玩完后立刻想重试的游戏,因为你“知道”自己看到了那个闭包 Bug。我挑选的都是曾经困扰过我或我认识的人的 Bug,所以如果你以编写 JS 为生,其中一些会让你感同身受。
The experiment hiding inside Here’s the hackathon part. When you get an answer wrong, the game has to teach you something. But HOW should it do that? I had two competing instincts: hint_then_retry: give you a nudge, let you try the same snippet again, reward the recovery explain_now: show the full explanation immediately, keep the pace fast I genuinely didn’t know which one makes people play better. So instead of arguing with myself, I wired it up as a real A/B experiment with Flagsmith. A multivariate flag (wrong_answer_feedback) decides which feedback style you get, and Flagsmith’s Experimentation tracks what happens next: on your very next question, do you get it right? That’s the metric: paired_followup_correct - whether you answer correctly right after being taught. If hints make the learning stick, that number should be higher for hint players. If instant explanations work better, it shows there.
隐藏在其中的实验,这就是黑客松的部分。当你答错时,游戏必须教你一些东西。但应该“如何”教呢?我有两种相互冲突的直觉:hint_then_retry(提示后重试):给你一点暗示,让你再次尝试同一个片段,并奖励你的纠错行为;explain_now(立即解释):直接显示完整解释,保持节奏快速。我真的不知道哪种方式能让人们玩得更好。因此,我没有纠结,而是用 Flagsmith 将其连接成一个真正的 A/B 实验。一个多变量标志(wrong_answer_feedback)决定了你获得哪种反馈风格,而 Flagsmith 的实验功能会跟踪接下来的情况:在你的下一道题中,你答对了吗?这就是衡量指标:paired_followup_correct(配对后续正确率)——即在被教导后是否能立即答对。如果提示能加深学习效果,那么提示组玩家的这个数值应该更高。如果即时解释效果更好,数据也会体现出来。
My prediction (locked before launch) Before anyone played, I wrote down my call: hint_then_retry wins. My reasoning: re-trying forces you to actually find the bug yourself the second time, and that effort is what makes it stick. Instant explanations feel good but you skim them. I’m logging this publicly so I can’t quietly edit my priors after the results come in. Science!
我的预测(发布前锁定):在任何人玩之前,我写下了我的判断:hint_then_retry 会赢。我的理由是:重试会迫使你在第二次尝试时真正自己找到 Bug,而这种努力正是让知识扎根的原因。即时解释感觉很好,但你只会草草浏览。我公开记录这一点,这样我就不能在结果出来后悄悄修改我的先验假设了。这就是科学!
What I’ve learned so far Honest status: the experiment is live and collecting, but the data is still thin. I only just started sharing the game, so enrollment is in single digits and both arms need a lot more players before the win probability means anything. Flagsmith’s Bayesian engine also shows a credible interval next to the result, and right now that interval crosses zero, which is stats-speak for “we don’t know yet”. I’m not going to pretend otherwise. What I already know: building the game was the easy part. Getting real humans to play it is the actual boss fight.
到目前为止我学到了什么:诚实地说,实验已经上线并正在收集数据,但数据量仍然很少。我才刚刚开始分享这个游戏,所以参与人数是个位数,在胜率具有统计学意义之前,两个实验组都需要更多的玩家。Flagsmith 的贝叶斯引擎还在结果旁边显示了一个可信区间,目前该区间跨越了零,这是统计学术语,意思是“我们还不知道”。我不会假装知道。我已经知道的是:构建游戏是简单部分,让真实的人来玩才是真正的“大魔王”关卡。
Come be a data point Play it, tell me your score, and if you spotted a bug in my bug-spotting game (meta, I know), the repo is https://github.com/doomsage/spot-the-bug/ Every play genuinely helps - you’re one visitor in a live experiment, and your clicks decide which feedback style ships. If the results are interesting (or embarrassing), I’ll post a follow-up with the numbers after the hackathon. Play here: https://doomsage.github.io/spot-the-bug/ Built for Toggle Wars. Flagsmith handles the flag, the experiment split and the stats; the game is vanilla JS on GitHub Pages.
来成为一个数据点吧:去玩一下,告诉我你的分数。如果你在我的“找 Bug”游戏中发现了 Bug(我知道这很元),仓库地址是 https://github.com/doomsage/spot-the-bug/。每一次游玩都非常有帮助——你是实时实验中的一名访客,你的点击决定了哪种反馈风格最终胜出。如果结果很有趣(或者很尴尬),我会在黑客松结束后发布后续文章并公布数据。在此游玩:https://doomsage.github.io/spot-the-bug/。该项目为 Toggle Wars 而建。Flagsmith 处理标志、实验分组和统计数据;游戏本身是托管在 GitHub Pages 上的原生 JS。