Skip to content

Add new brain game: Bullet Math#112

Closed
aleenaharoldpeter wants to merge 2 commits into
ajaynegi33:mainfrom
aleenaharoldpeter:feature/bullet-math
Closed

Add new brain game: Bullet Math#112
aleenaharoldpeter wants to merge 2 commits into
ajaynegi33:mainfrom
aleenaharoldpeter:feature/bullet-math

Conversation

@aleenaharoldpeter

@aleenaharoldpeter aleenaharoldpeter commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

🧮 New Game: Bullet Math

This PR adds a new brain game Bullet Math under src/app/game/bullet-math/.

✨ Features

  • Supports 3 difficulty levels:
    • Amateur → single-digit operations
    • Normal → two-digit operations and mid-level multiplication/division
    • Veteran → multi-digit, 3×2 style multiplication, and challenging division
  • Timer-based gameplay (2 minutes per session).
  • Score & attempted questions tracking.
  • End-game popup with:
    • 🎉 Time’s Up message
    • ⭐ Final score
    • 📊 Questions attempted
    • 🔄 Play Again button
    • 🏠 Back to Homepage button
  • Math Hack hints for Veteran mode (e.g., breaking down 3×2 multiplication, compensation tricks).

🛠️ Fixes/Changes

  • Updated src/app/game/page.tsx to include the new Bullet Math entry in the game selection.
  • Added new folder: src/app/game/bullet-math/ containing:
    • page.tsx → Game logic
    • page.module.css → Styling

✅ Checklist

  • Linked to homepage game list
  • Added new game code
  • Tested locally with all difficulty levels
  • End-game popup flow verified

This PR introduces a fresh math challenge game to the project. 🚀

@vercel

vercel Bot commented Sep 5, 2025

Copy link
Copy Markdown

@aleenaharoldpeter is attempting to deploy a commit to the ajaynegi45's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Sep 5, 2025

Copy link
Copy Markdown

👋 Hello @aleenaharoldpeter!

Thanks for contributing to Old-School-Game – a curated collection of classic, brain-training games that boost memory, focus, creativity, and long-term brain health 🎯🧠.

In today's world full of short-form distractions, this project helps rebuild deep focus and mental endurance through thoughtful gameplay.


✅ Important Things To Do:

  • 🌟 Don’t forget to ⭐ Star the repo and follow @ajaynegi45 for updates, ideas, and dev insights.
  • 📬 Stay inspired! Sign up for the monthly CodiesCoder Newsletter – we explore one key software engineering topic each month, beginner-friendly and fun to read!

✅ Your pull request has been submitted successfully, and a maintainer will review it soon.

@coderabbitai

coderabbitai Bot commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Summary by CodeRabbit

  • New Features

    • Added a new Bullet Math game with timed play, three difficulty levels, scoring, attempts tracking, and Enter-to-submit.
    • Includes contextual hints at higher difficulty, a live status bar, and an end-of-game overlay with Play Again and Back to Homepage options.
    • Added a new card in the game selection UI to access Bullet Math.
  • Style

    • Introduced complete styling for the Bullet Math page: layout, buttons with color variants, input states, status bar, overlay/modal, hint box, and responsive adjustments for small screens.

Walkthrough

Adds a new client-side Bullet Math game page with timed arithmetic gameplay, difficulty levels, hints, scoring, and end-of-game overlay; adds CSS module styles for the game page; and registers a Bullet Math card on the game selection page.

Changes

Cohort / File(s) Summary of Changes
Bullet Math React page
src/app/game/bullet-math/page.tsx
New client-side React component implementing a 120s timed arithmetic game with three difficulties, equation generation (including divisible division), veteran hints, input validation, scoring/attempts, timer management, and end-of-game overlay with Play Again / Back to Homepage.
Bullet Math styles (CSS Module)
src/app/game/bullet-math/page.module.css
New CSS module adding layout, status bar, equation box, buttons (.btn + color variants), radio group, large input, wrong state, overlay/modal, hint box, menu button gradient, and responsive rules (breakpoint at max-width: 400px).
Game selection catalog
src/app/game/page.tsx
Imported BulletMath asset and added a new Card entry linking to bullet-math with branding (Bullet Math, BulletMath.png, bg #F59E0B, white text).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Player
    participant Page as BulletMath Page
    participant Gen as EquationGenerator
    participant Timer
    participant UI as Overlay/UI

    Player->>Page: Select difficulty & Click Start
    Page->>Gen: generateEquation(difficulty)
    Gen-->>Page: equation {a, op, b, answer, hint}
    Page->>Timer: start(120s)
    loop every second
        Timer-->>Page: tick (timeLeft--)
        alt timeLeft == 0
            Page->>Timer: stop()
            Page-->>UI: show Game Over overlay
        end
    end

    Player->>Page: Submit answer (Enter)
    alt valid && correct
        Page->>Page: increment score & attempts
        Page->>Gen: generateEquation(difficulty)
    else wrong/invalid
        Page-->>Player: mark input as wrong
    end

    Player->>UI: Play Again
    UI->>Page: reset state & restart
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related issues

  • [NEW GAME] Bullet Math #111 — Matches the Bullet Math feature spec: equation generation, makeDivisible/division handling, 120s timer, scoring and answer validation.

Possibly related PRs

  • Schulte table game #79 — Also modifies src/app/game/page.tsx to add a new game Card; related at the component/catalog integration level.

Poem

Numbers sprint and targets blink, ✨
Seconds fall and thinkers think.
Plus, minus, times that split just right—
Hints appear for veteran sight.
Press play again, the score takes flight. 🎯


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 17ee2d4 and 93583dc.

📒 Files selected for processing (2)
  • src/app/game/bullet-math/page.module.css (1 hunks)
  • src/app/game/bullet-math/page.tsx (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @codiescoder summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @codiescoder anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot added enhancement New feature or request level3 size:L This PR changes 100-499 lines, ignoring generated files labels Sep 5, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 486c828 and 17ee2d4.

⛔ Files ignored due to path filters (1)
  • public/BulletMath.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • src/app/game/bullet-math/page.module.css (1 hunks)
  • src/app/game/bullet-math/page.tsx (1 hunks)
  • src/app/game/page.tsx (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/app/game/page.tsx (1)
src/app/game/bullet-math/page.tsx (1)
  • BulletMath (114-267)
🪛 Biome (2.1.2)
src/app/game/bullet-math/page.tsx

[error] 224-226: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 248-259: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)


[error] 259-261: Provide an explicit type prop for the button element.

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

(lint/a11y/useButtonType)

Comment on lines +62 to +79
.input {
font-size: 28px;
font-weight: 600;
text-align: center;
padding: 10px 16px;
margin-left: 12px;
width: 120px; /* consistent width */
border: 2px solid #aaa;
border-radius: 10px;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
border-color: #2563eb; /* nice blue highlight */
box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Deduplicate .input rules (keep one, add missing transition).

Two .input blocks + two :focus blocks create maintenance risk. Merge into one.

 .input {
   font-size: 28px;
   font-weight: 600;
   text-align: center;
   padding: 10px 16px;
   margin-left: 12px;
   width: 120px;          /* consistent width */
   border: 2px solid #aaa;
   border-radius: 10px;
   outline: none;
-  transition: border-color 0.2s, box-shadow 0.2s;
+  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
 }
 
-.input:focus {
-  border-color: #2563eb; /* nice blue highlight */
-  box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
-}
-
-/* duplicate starts */
-.input {
-  font-size: 28px;
-  font-weight: 600;
-  text-align: center;
-  padding: 10px 16px;
-  margin-left: 12px;
-  width: 120px;
-  border: 2px solid #aaa;
-  border-radius: 10px;
-  outline: none;
-  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
-}
-
 .input:focus {
   border-color: #2563eb;
   box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
 }

Also applies to: 119-136

🤖 Prompt for AI Agents
In src/app/game/bullet-math/page.module.css around lines 62 to 79 (and similarly
lines 119 to 136), there are duplicate .input and .input:focus rule blocks—merge
them into one .input block and one .input:focus block to avoid maintenance risk;
ensure the single .input includes font-size, font-weight, text-align, padding,
margin-left, width, border, border-radius, outline, and a transition that covers
both border-color and box-shadow, and ensure the single .input:focus sets
border-color and box-shadow as in the originals, then remove the duplicated rule
sets at lines 119-136.

Comment thread src/app/game/bullet-math/page.module.css
Comment thread src/app/game/bullet-math/page.tsx Outdated
Comment thread src/app/game/bullet-math/page.tsx
Comment thread src/app/game/bullet-math/page.tsx
Comment thread src/app/game/bullet-math/page.tsx Outdated
Comment thread src/app/game/bullet-math/page.tsx
Comment thread src/app/game/page.tsx
@vercel

vercel Bot commented Sep 5, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
time-pass Error Error Sep 5, 2025 4:42am

@ajaynegi33

Copy link
Copy Markdown
Owner
Screenshot 2025-09-05 at 10 13 14 AM

Resolve this error

@ajaynegi33 ajaynegi33 closed this Sep 5, 2025
@aleenaharoldpeter

Copy link
Copy Markdown
Contributor Author

@ajaynegi45 working on it

This was referenced Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request level3 size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants