update cc problem paths

This commit is contained in:
Harivansh Rathi 2025-12-14 16:34:50 -05:00
parent 7d711afd68
commit ecf63dcff3
4 changed files with 30 additions and 9 deletions

View file

@ -11,9 +11,15 @@ Add additional test cases to an existing problem to make it more challenging or
## Problem ## Problem
Problem name: $ARGUMENTS (if empty, ask which problem) Problem name: $ARGUMENTS (if empty, ask which problem)
## Find the problem
First, find the veetcode problems directory:
```bash
VEET_DIR=$(veet problems-dir 2>/dev/null || echo "$HOME/.veetcode/problems")
```
## Process ## Process
1. Read the existing solution.py and tests.py for the problem 1. Read the existing solution.py and tests.py from $VEET_DIR/*/{problem-name}/
2. Analyze what edge cases are NOT covered 2. Analyze what edge cases are NOT covered
3. Ask the user what kind of tests they want: 3. Ask the user what kind of tests they want:
- Edge cases (empty, single element, boundaries) - Edge cases (empty, single element, boundaries)

View file

@ -10,9 +10,15 @@ After the user has solved a problem (or given up), explain the optimal solution
## Problem ## Problem
Problem name: $ARGUMENTS (if empty, ask which problem) Problem name: $ARGUMENTS (if empty, ask which problem)
## Find the problem
First, find the veetcode problems directory:
```bash
VEET_DIR=$(veet problems-dir 2>/dev/null || echo "$HOME/.veetcode/problems")
```
## Process ## Process
1. Read their solution.py to see their implementation 1. Read their solution.py from $VEET_DIR/*/{problem-name}/ to see their implementation
2. Provide explanation covering: 2. Provide explanation covering:
### For a CORRECT solution: ### For a CORRECT solution:

View file

@ -31,10 +31,14 @@ Before writing any files, mentally design:
- Edge cases - Edge cases
### Step 3: Create Directory ### Step 3: Create Directory
First, find the veetcode problems directory:
```bash ```bash
mkdir -p problems/{difficulty}/{problem-name} VEET_DIR=$(veet problems-dir 2>/dev/null || echo "$HOME/.veetcode/problems")
mkdir -p "$VEET_DIR/{difficulty}/{problem-name}"
``` ```
All file operations should use `$VEET_DIR/{difficulty}/{problem-name}/` as the base path.
### Step 4: Write solution.py (SKELETON ONLY) ### Step 4: Write solution.py (SKELETON ONLY)
Write ONLY the skeleton - never include the solution! Write ONLY the skeleton - never include the solution!
@ -119,7 +123,7 @@ class TestEdgeCases:
You MUST verify the tests are solvable before telling the user. Run this verification using inline Python - DO NOT write the solution to any file: You MUST verify the tests are solvable before telling the user. Run this verification using inline Python - DO NOT write the solution to any file:
```bash ```bash
cd problems/{difficulty}/{problem-name} && python -c " cd "$VEET_DIR/{difficulty}/{problem-name}" && python -c "
import sys import sys
from types import ModuleType from types import ModuleType
@ -155,9 +159,9 @@ Only after verification passes, tell the user:
``` ```
✅ Problem created and verified! ✅ Problem created and verified!
📁 Location: problems/{difficulty}/{problem-name}/ 📁 Location: $VEET_DIR/{difficulty}/{problem-name}/
📝 Edit: solution.py 📝 Open: veet open {problem-name}
🚀 Run: uv run veetcode → select "{problem-name}" 🚀 Run: veet → select "{problem-name}"
Good luck! Good luck!
``` ```

View file

@ -38,5 +38,10 @@ Problem name: $ARGUMENTS (if empty, ask which problem they need help with)
- Ask if they want more specific hints after each level - Ask if they want more specific hints after each level
- Encourage them to try implementing after each hint - Encourage them to try implementing after each hint
## Read the problem first ## Find the problem
Read: problems/*/$ARGUMENTS/solution.py (find the matching problem directory) First, find the veetcode problems directory:
```bash
VEET_DIR=$(veet problems-dir 2>/dev/null || echo "$HOME/.veetcode/problems")
```
Then read: $VEET_DIR/*/$ARGUMENTS/solution.py (find the matching problem directory)