Inspiration We were inspired by the classic "24 Game" and wanted to create a modern, engaging twist on mathematical puzzle games. The name "Nerd Insult Game" playfully embraces the stereotype that math enthusiasts are "nerds" - turning it into a badge of honor. We wanted to build something that would make math fun and accessible while challenging players to think creatively about number combinations and mathematical operations.
What it does Nerd Insult Game is an interactive mathematical puzzle game built on Reddit's Devvit platform. Players are presented with a grid of cards containing numbers and mathematical operators (+, -, ×, ÷), along with a target number. The challenge is to select exactly three cards and arrange them to create an equation that equals the target number.
Key features include:
Dynamic card generation with smart algorithms ensuring solvable puzzles Multiple difficulty levels (Easy, Medium, Hard) with varying grid sizes and number ranges Progress tracking showing how many solutions you've found out of all possible solutions Solution deduplication using mathematical equivalence to avoid counting the same solution multiple times Responsive design that works seamlessly across desktop and mobile devices Real-time feedback with visual indicators for correct/incorrect solutions How we built it We built the game using Reddit's Devvit platform, which allows for interactive web applications within Reddit posts. Our tech stack includes:
Frontend: React with TypeScript for the interactive game interface Backend: Express.js server for game logic and state management Styling: Custom CSS with Tailwind for responsive design and animations Game Logic: Custom algorithms for card generation, solution validation, and mathematical expression evaluation Math Processing: Math.js library for robust mathematical expression parsing and evaluation Build Tools: Vite for fast development and optimized builds The architecture follows a clean separation of concerns with shared utilities for game logic, mathematical operations, and progress tracking. We implemented sophisticated algorithms for generating valid game configurations and ensuring mathematical accuracy.
Challenges we ran into Mathematical Expression Evaluation: Ensuring accurate calculation of complex expressions with proper operator precedence was tricky. We solved this by integrating Math.js for reliable expression parsing.
Solution Deduplication: Identifying mathematically equivalent solutions (like "2 + 3 × 4" vs "3 × 4 + 2") required implementing normalization algorithms to avoid counting duplicates.
Game Balance: Creating puzzles that are challenging but always solvable required developing smart card generation algorithms with built-in validation and fallback mechanisms.
Responsive Design: Making the game work well on both desktop and mobile while maintaining visual appeal and usability across different screen sizes.
Performance Optimization: Ensuring smooth animations and interactions while calculating all possible solutions in real-time without blocking the UI.
Accomplishments that we're proud of Robust Game Logic: Built a sophisticated system that generates mathematically valid puzzles 100% of the time Elegant User Experience: Created an intuitive interface with smooth animations and clear visual feedback Mathematical Accuracy: Implemented precise solution validation and deduplication algorithms Responsive Design: Achieved excellent usability across all device types Performance: Optimized the game to handle complex calculations without lag Code Quality: Maintained clean, well-documented, and maintainable code throughout the project What we learned Advanced React Patterns: Gained deeper understanding of state management and component optimization Mathematical Programming: Learned to implement complex mathematical algorithms in JavaScript Devvit Platform: Mastered Reddit's development platform and its unique constraints and opportunities Game Design: Understood the importance of balancing challenge with accessibility in puzzle games Performance Optimization: Learned techniques for handling computationally intensive tasks in web applications User Experience: Gained insights into creating intuitive interfaces for mathematical applications What's next for Nerd Insult Game Multiplayer Mode: Add competitive gameplay where players race to find solutions Daily Challenges: Implement special puzzle modes with unique constraints and rewards Achievement System: Add badges and milestones for different accomplishments Social Features: Enable players to share their best solutions and challenge friends Advanced Difficulty Modes: Introduce new mechanics like time pressure or limited attempts Educational Integration: Partner with educational platforms to use the game as a learning tool Mobile App: Develop a standalone mobile application for broader accessibility AI Opponent: Create an AI challenger that adapts to player skill level The game represents a perfect blend of mathematical challenge and modern web technology, making math engaging and accessible to Reddit's diverse community.
Built With
- devvit
- react
- typescript

Log in or sign up for Devpost to join the conversation.