Inspiration
Learning to code today is often lonely, repetitive, and tedious. Many aspiring developers experience it as a slow, solitary grind with little feedback or engagement. Self-teaching lacks structure, and with AI increasingly filling in answers, learners are losing opportunities to build muscle memory, sharpen critical thinking, and truly understand the basics.
We asked ourselves a simple question: What do you get when you cross the problem-solving of LeetCode, the intensity of Tetris 99, and the chaos of Exploding Kittens? That question became CodeBattles.
What it does
CodeBattles transforms coding practice from a solo activity into a competitive, community-driven experience. Players join a room using a shared code—similar to Kahoot—and compete simultaneously by solving short coding challenges.
Each correct solution directly affects other players through buffs and attacks. Instead of passively grinding problems, players must think fast, adapt under pressure, and strategically manage limited time. CodeBattles helps players internalize fundamentals, improve speed, and keep their problem-solving skills sharp in a high-energy environment.
How we built it
We built CodeBattles as a real-time multiplayer web application. The frontend uses a modern reactive framework to deliver a responsive game UI with live timers, code editors, and animated effects. The backend manages game logic, player state, room synchronization, and secure code execution.
Each room runs as an isolated game session. A custom code runner validates submissions against predefined test cases, while the game engine handles timers, card effects, player eliminations, and state consistency across all participants. The architecture is modular, making it easy to add new cards, effects, and game modes.
Challenges we ran into
One major challenge was maintaining real-time synchronization across multiple players while keeping the system fair and responsive. We also had to securely execute and test user-submitted code without sacrificing performance. Balancing gameplay was another challenge—ensuring that attacks and debuffs were impactful without being frustrating or overwhelming.
Accomplishments that we're proud of
We’re proud of building a fully playable competitive coding platform that feels fast, intense, and fun. Our card-based gameloop successfully turns coding fundamentals into strategic gameplay, and the real-time room system enables social, high-energy matches. Most importantly, we created an experience that motivates players to actively practice coding instead of passively consuming solutions.
What we learned
We learned that engagement in learning tools comes from pressure, feedback, and interaction. Short problems, immediate results, and competitive mechanics dramatically change how users approach coding. We also gained experience designing scalable multiplayer systems and building secure, modular game architectures.
What's next for CodeBattles
Next, we plan to expand CodeBattles with ranked matchmaking, team modes, boss battles, and arena ladders. We want to introduce classroom and organization dashboards, analytics, and custom question packs. Long-term, our goal is to make coding social, competitive, and genuinely fun—bringing problem-solving into the world of games.
Note
https://github.com/moromorad/CodeBattles-Final-Clean: This is final project https://github.com/moromorad/NewCodeBattles/tree/frontend-implementation: This is for commit history
Built With
- flask
- flask-socketio
- monaco-editor
- python
- react
- socket.io
- tailwind-css
- typescript
- vite
- zustand
Log in or sign up for Devpost to join the conversation.