DEV Community

Cover image for I Developed a Game Called “Bug Sniper” for Finding Bugs in Code
Atsushi
Atsushi

Posted on

I Developed a Game Called “Bug Sniper” for Finding Bugs in Code

Recently, I released the code-review gamification project “Code Review Game.”

This time, I created another game called “Bug Sniper,” where the goal is to find bugs hidden in code.

https://bug-sniper.goofmint.workers.dev/

Code Review Game was originally designed for conference booths so that attendees could give it a try. However, it ended up becoming something that required fairly serious review skills. While this was useful from a learning perspective, it required a PC and wasn’t something you could casually enjoy.

With that in mind, I created Bug Sniper as a more lightweight, pick-up-and-play experience.

How to Play Bug Sniper

Bug Sniper is a game where you keep finding bugs in code for 60 seconds straight.

Each problem contains around one or two bugs.

For example, consider the following code:

function getLastElement(arr) {
  // Initialize variables
  const index = arr.length;
  return arr[index];
}
Enter fullscreen mode Exit fullscreen mode

Even though the function name is getLastElement, it contains a bug where it fails to retrieve the final element in the array. The correct code should use const index = arr.length - 1;.

Problems like this are provided across Levels 1–3. Problems appear randomly. Consecutive correct answers create a combo and boost your score. A mistake costs -1 point. After a correct answer or a miss, you can skip to the next problem.

When the Game Ends

The game automatically ends after 60 seconds. At the end, you’ll see a screen like this. Results are stored in Cloudflare D1.

Once the score is saved, you enter a name and get feedback from the LLM.

Here's an example of the LLM’s evaluation. It’s... not perfect.

When you share your result, an OGP image like the following is generated.

https://twitter.com/goofmint/status/1992588516954718673

Architecture

This project also heavily relies on Cloudflare. It uses:

  • Cloudflare Workers
    • Frontend built with React Router + TailwindCSS
  • Cloudflare R2
    • For storing OGP images
  • Cloudflare D1
    • For ranking data

The LLM used for evaluating results is Gemini 2.5-Flash.

Supported Languages

As of now, the following languages are supported:

  • JavaScript
  • Python
  • PHP
  • Ruby
  • Java
  • Dart

Bug Explanations

When you correctly identify a bug, a toast notification appears with an explanation like this:

You may not have time to read it mid-game, but it can be useful when you click something by intuition.

Rankings

A ranking system—missing from the previous Code Review Game—has been added. You can view rankings from the past week, either overall or per language.

Development Notes

I again used Claude Code on the web for development. Using the original $1,000 coupon, I think the total cost was around $60, just like last time (the interface no longer shows exact usage, so the exact amount is unknown).

Code reviews for generated PRs were handled, as always, by CodeRabbit. Since CodeRabbit is free for public repositories, it's perfect for individual developers.

Here is an example pull request. Review locales (English, Spanish, Japanese, Chinese, etc.) can be switched in the settings.

feat: Implement game logic with random problem selection by goofmint · Pull Request #5 · goofmint/BugSniper

For Streamers

Someone politely asked for permission to stream the previous Code Review Game. I’m not sure whether Bug Sniper will get similar requests, but to be safe, here are the guidelines:

  • Streaming is fully allowed
  • Monetized streams are also allowed
  • If possible, please let me know on X
  • And if you could mention CodeRabbit even a little, it would make me very happy

Conclusion

Bug Sniper will be available for attendees to play at future CodeRabbit booth exhibitions. It's far more casual than Code Review Game, so please give it a try.

Bug Sniper

Top comments (0)