Inspiration
The idea for Math Attack came from a simple observation: people spend hours scrolling through Reddit, but this time rarely contributes to skill development. What if we could gamify browsing to make it both entertaining and educational? I wanted to create something that would challenge users' mental math abilities without disrupting their natural Reddit experience.
What it does
It simply provides users with random arithmetic questions to solve while they browse
How we built it
Math Attack is architected as a Reddit Devvit app with several key components: Game Engine: Random problem generation with four operation types (±×÷) and adaptive difficulty scaling Timing System: Unpredictable intervals (10-30 seconds) that pause during active problem-solving Data Layer: Redis backend for persistent user statistics and real-time leaderboard management UI/UX: Modal-based math challenges with immediate feedback and accessibility features The core algorithm generates problems like: a + b = ? where difficulty adjusts based on user accuracy and response time.
Challenges we ran into
Timing Precision: Ensuring math attacks appear at truly random intervals without overwhelming users State Management: Maintaining game state across Reddit's navigation and page changes Performance Optimization: Handling rapid data updates for leaderboards without lag User Experience: Balancing challenge frequency to be engaging but not annoying Mobile Responsiveness: Creating modals that work seamlessly across all device sizes
Accomplishments that we're proud of
The whole app is an accomplishment to be honest, this is my first reddit game, first made on devvit and i joined the hackaton late. But still managed to pull it off
What we learned
Building Math Attack taught me several valuable lessons: Seamless Integration: Creating non-intrusive game mechanics that enhance rather than interrupt user experience Real-time Data Management: Implementing efficient leaderboard systems with Redis for instant updates Adaptive Difficulty: Developing algorithms that adjust problem complexity based on user performance Cross-platform Optimization: Ensuring smooth gameplay across desktop and mobile devices
What's next for math-attack
To win the prize, keep improving
Built With
- css
- devvit
- express.js
- html
- node.js
- react
- redis
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.