🥷 Stealth Math Solver
The Ultimate Stealth Math Lab for VS Code.
Solve algebra equations, expand binomials, factor polynomials, and generate practice problems directly inside code comments — without ever leaving your editor or switching tabs!
⚡ Features at a Glance
| Shortcut |
Command |
Description |
Example Input |
Output After Shortcut |
Alt + M |
stealthMath.solve |
Inline Solver: Solves linear/quadratic equations or evaluates arithmetic |
// 3*x + 10 = 25 |
// 3*x + 10 = 25 => [ x = 5 ] |
Alt + E |
stealthMath.expand |
Expression Expander: Expands algebraic expressions into standard form |
// (x + 4)^2 |
// (x + 4)^2 => x^2 + 8*x + 16 |
Alt + F |
stealthMath.factor |
Expression Factorer: Factors polynomials back into products |
// x^2 + 8*x + 16 |
// x^2 + 8*x + 16 => (x + 4)^2 |
Alt + G |
stealthMath.generateQuestion |
Practice Generator: Inserts a new random algebra question in comment format |
(empty line) |
// PRACTICE: Solve for x -> 4*x - 7 = 13 |
Alt + Shift + C |
stealthMath.clearComments |
Panic Clean (Stealth Mode): Wipes all math practice comments before anyone notices |
(any line) |
Zero footprints left in your file! |
🚀 How to Run & Test (Quick Start)
Method 1: Instant Test via VS Code F5 (Recommended)
- Open this workspace folder (
master-math) in VS Code.
- Press
F5 (or go to Run and Debug tab and click "Run Extension (F5)").
- A new Extension Development Host VS Code window will open.
- Open the included
demo.js file.
- Put your cursor on any comment and press
Alt + M, Alt + E, Alt + F, or Alt + G!
Method 2: Permanent Local Installation (In Any Project)
To use Stealth Math anywhere on your PC without publishing to the marketplace:
Option A: One-line Copy to VS Code Extensions Directory
Run this in PowerShell:
Copy-Item -Path "c:\Users\Dell\Documents\GitHub\master-math" -Destination "$env:USERPROFILE\.vscode\extensions\stealth-math-solver-1.0.0" -Recurse -Force
Restart or reload VS Code (Ctrl + Shift + P -> Developer: Reload Window). Done! Stealth Math is now installed globally in your VS Code!
Option B: Build .vsix Package
npx @vscode/vsce package --no-dependencies
Then in VS Code:
- Open the Extensions view (
Ctrl + Shift + X).
- Click the
... (Views and More Actions) menu in the top right.
- Select Install from VSIX... and pick
stealth-math-solver-1.0.0.vsix.
🧠 Detailed Feature Walkthrough
1. Instant Inline Solver (Alt + M)
Works on both single selections and entire lines! You don't even need to select text — just place your cursor anywhere on the comment line:
- Linear Equations:
// 3*x + 10 = 25
// Press Alt + M:
// 3*x + 10 = 25 => [ x = 5 ]
- Custom Variables (Automatically detected!):
# 5*y - 14 = 21
# Press Alt + M:
# 5*y - 14 = 21 => [ y = 7 ]
- Quadratic Equations:
// x^2 - 5*x + 6 = 0
// Press Alt + M:
// x^2 - 5*x + 6 = 0 => [ x = 2, 3 ]
- Arithmetic Drills:
// 25 * 4 + 180 / 9
// Press Alt + M:
// 25 * 4 + 180 / 9 => [ 120 ]
2. Expression Expansion (Alt + E)
Expands binomials and products, automatically ordering polynomials in descending degrees ($x^2 + 8x + 16$):
// (x + 4)^2
// Press Alt + E:
// (x + 4)^2 => x^2 + 8*x + 16
// (2*x - 3)*(x + 5)
// Press Alt + E:
// (2*x - 3)*(x + 5) => 2*x^2 + 7*x - 15
3. Expression Factoring (Alt + F)
Factors expressions back into clean factor groups:
// x^2 + 8*x + 16
// Press Alt + F:
// x^2 + 8*x + 16 => (x + 4)^2
// x^2 - 49
// Press Alt + F:
// x^2 - 49 => (x + 7)*(x - 7)
4. Auto Practice Generator (Alt + G)
Place your cursor on any empty line and hit Alt + G. It generates diverse, solvable problems with clean integer solutions:
// PRACTICE: Solve for x -> 4*x - 7 = 13
// PRACTICE: Expand -> (x + 5)^2
// PRACTICE: Solve for x -> x^2 - 6*x + 8 = 0
// PRACTICE: Factor -> x^2 + 12*x + 35
Seamless Flow: After generating a question with Alt + G, just hit Alt + M on that line, and Stealth Math will automatically strip the prompt and solve it right away!
Stealth Math automatically adapts to the file format you are working in:
- JavaScript / TypeScript / Java / C / C++ / Go / Rust / PHP / Dart / Swift:
//
- Python / Ruby / Bash / PowerShell / YAML / R / Perl:
#
- SQL / Lua / Ada / Haskell:
--
- HTML / XML:
<!-- ... -->
- CSS / SCSS / LESS:
/* ... */
6. Panic Clean Mode (Alt + Shift + C)
Practicing math inside a real work project? If someone approaches your desk:
- Press
Alt + Shift + C
- It removes every single practice problem and math answer comment from the current file!
- Clean git diff, zero footprints, zero suspicion. (And
Ctrl + Z brings them back if needed!).
🧪 Testing
Run the built-in unit test suite:
npm test
Outputs:
🧪 Starting Stealth Math Solver Unit Tests...
✅ cleanMathInput passed all assertions.
✅ solveMath (Linear) passed all assertions.
✅ solveMath (Quadratic) passed all assertions.
✅ solveMath (Arithmetic) passed all assertions.
✅ expandMath passed all assertions.
✅ factorMath passed all assertions.
✅ questionGenerator passed all assertions.
🎉 ALL 7 UNIT TEST SUITES PASSED PERFECTLY!
📁 Repository Structure
master-math/
├── .vscode/
│ └── launch.json # VS Code F5 debug configuration
├── extension.js # Main extension entrypoint & command hooks
├── mathEngine.js # Symbolic math solver & parser (nerdamer CAS)
├── questionGenerator.js # Problem generator & language comment syntax
├── demo.js # Interactive test playground
├── test-suite.js # Unit test suite
├── package.json # Extension metadata, keybindings & menu contributions
├── .vscodeignore # Packaging rules
└── README.md # Complete documentation