Skip to content

Commit 355a139

Browse files
committed
Add capstone index, hint guides, link checks, and Python checklist parity
1 parent 3995529 commit 355a139

14 files changed

Lines changed: 340 additions & 0 deletions

File tree

.github/workflows/cpp-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
sudo apt update
1717
sudo apt install -y g++
1818
19+
- name: Check markdown links
20+
run: bash ./scripts/check-links.sh
21+
1922
- name: Compile all C++ files
2023
run: bash ./scripts/build-all.sh
2124

@@ -32,6 +35,11 @@ jobs:
3235
install: >-
3336
mingw-w64-ucrt-x86_64-gcc
3437
38+
- name: Check markdown links
39+
shell: msys2 {0}
40+
run: |
41+
./scripts/check-links.sh
42+
3543
- name: Compile all C++ files
3644
shell: msys2 {0}
3745
run: |

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ You can also validate all C++ files with:
2424
- `./scripts/build-all.ps1` (PowerShell)
2525
- `bash ./scripts/build-all.sh` (Bash)
2626

27+
Validate markdown links with:
28+
29+
- `./scripts/check-links.ps1` (PowerShell)
30+
- `bash ./scripts/check-links.sh` (Bash)
31+
2732
4. Update related README files when behavior or structure changes.
2833
5. Open a pull request with a clear description of what changed and why.
2934

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Python parity starter modules live in `languages/python/01-foundations`:
4848
- read `README.md`
4949
- run `example/main.cpp`
5050
- solve `exercises/01.cpp` and `exercises/02.cpp`
51+
- use level `HINTS.md` only when blocked
5152
- follow the level order from foundations to expert
5253
4. Mark progress in `languages/cpp/CHECKLIST.md`
5354
5. Build capstones in `languages/cpp/projects/`
@@ -108,6 +109,20 @@ g++ -std=c++17 -Wall -Wextra -pedantic
108109

109110
CI also validates this on Linux and Windows in `.github/workflows/cpp-build.yml`.
110111

112+
You can validate markdown links with:
113+
114+
PowerShell:
115+
116+
```powershell
117+
./scripts/check-links.ps1
118+
```
119+
120+
Bash:
121+
122+
```bash
123+
bash ./scripts/check-links.sh
124+
```
125+
111126
## Contribution Summary
112127

113128
Contributions are welcome. Please:
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# 01 Foundations Hints
2+
3+
Use these hints only after attempting each exercise.
4+
5+
## types-and-io
6+
7+
### Exercise 01 hints
8+
9+
- Track `sum` while reading values.
10+
- Initialize `min` and `max` from the first input value, not from `0`.
11+
- Compute `average` as `sum / n` after the loop.
12+
13+
### Exercise 02 hints
14+
15+
- Read three tokens: `product`, `price`, `quantity`.
16+
- Multiply `price * quantity` for total.
17+
18+
## operators-and-expressions
19+
20+
### Exercise 01 hints
21+
22+
- `hours = totalSeconds / 3600`
23+
- `minutes = (totalSeconds % 3600) / 60`
24+
- `seconds = totalSeconds % 60`
25+
26+
### Exercise 02 hints
27+
28+
- Apply discount before tax.
29+
- Tax percentage `x` is `x / 100.0`.
30+
31+
## control-flow
32+
33+
### Exercise 01 hints
34+
35+
- Check multiples of 15 before checking 3 or 5.
36+
37+
### Exercise 02 hints
38+
39+
- Stop when you read `-1`.
40+
- Only divide by `count` if `count > 0`.
41+
42+
## functions
43+
44+
### Exercise 01 hints
45+
46+
- Compare values step by step and keep a `currentMax`.
47+
48+
### Exercise 02 hints
49+
50+
- Convert characters with `std::tolower`.
51+
- Count `a, e, i, o, u`.
52+
53+
## arrays-and-vectors
54+
55+
### Exercise 01 hints
56+
57+
- Store values in `std::vector<int>`.
58+
- Print from index `n - 1` down to `0`.
59+
60+
### Exercise 02 hints
61+
62+
- Loop through vector and increment `frequency` on match.
63+
64+
## strings
65+
66+
### Exercise 01 hints
67+
68+
- Count transitions from whitespace to non-whitespace as new words.
69+
70+
### Exercise 02 hints
71+
72+
- Use two indexes (`left`/`right`) and skip non-letter characters.
73+
- Compare lowercase versions of letters.
74+
75+
## scope-and-lifetime-basics
76+
77+
### Exercise 01 hints
78+
79+
- Use a single `grade` variable and assign it in one branch chain.
80+
81+
### Exercise 02 hints
82+
83+
- Keep loop variable scoped inside `for`.
84+
- Keep `sum` outside loop.
85+
86+
## formatted-output-and-iomanip
87+
88+
### Exercise 01 hints
89+
90+
- Use `std::setw` for each column.
91+
- Keep `std::fixed << std::setprecision(2)` for money.
92+
93+
### Exercise 02 hints
94+
95+
- Set precision once before printing final results.
96+
- Reuse min/max pattern from foundations statistics exercises.

languages/cpp/01-foundations/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ This level builds the beginner mental model for writing small C++ programs.
2727
- [ ] You can compile each file with `-std=c++17 -Wall -Wextra -pedantic`.
2828
- [ ] You completed capstone project `languages/cpp/projects/01-foundations`.
2929

30+
Need guidance while solving? Use [HINTS.md](./HINTS.md).
31+
3032
After finishing this level, continue with [02-core](../02-core/README.md).

languages/cpp/02-core/HINTS.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# 02 Core Hints
2+
3+
Use these hints to debug your approach before reading or writing full solutions.
4+
5+
## input-validation
6+
7+
### Exercise 01 hints
8+
9+
- Use a `while (true)` loop.
10+
- On extraction failure: `cin.clear()` + `cin.ignore(...)`.
11+
- Validate range `[1, 100]` after successful extraction.
12+
13+
### Exercise 02 hints
14+
15+
- Validate count first, then each score.
16+
- Keep score range checks in the inner loop.
17+
18+
## algorithms-basics
19+
20+
### Exercise 01 hints
21+
22+
- Initialize `index = -1`.
23+
- Break loop when first match is found.
24+
25+
### Exercise 02 hints
26+
27+
- Initialize `min`/`max` from first element.
28+
- Update `evenCount` with `value % 2 == 0`.
29+
30+
## file-io-basics
31+
32+
### Exercise 01 hints
33+
34+
- Read full lines with `std::getline`.
35+
- Prefix each line with incremental number.
36+
37+
### Exercise 02 hints
38+
39+
- Loop until EOF.
40+
- Handle malformed rows by clearing stream and discarding bad line.
41+
42+
## sorting-and-searching
43+
44+
### Exercise 01 hints
45+
46+
- Selection sort: find smallest element in unsorted tail and swap.
47+
48+
### Exercise 02 hints
49+
50+
- Binary search condition: `left <= right`.
51+
- Adjust bounds based on `midValue < target`.
52+
53+
## maps-and-frequency-counting
54+
55+
### Exercise 01 hints
56+
57+
- Initialize counts for digits `0..9`.
58+
- Increment only if value is in valid range.
59+
60+
### Exercise 02 hints
61+
62+
- First pass: count each char.
63+
- Second pass: find first char with count `1`.
64+
65+
## error-handling-and-defensive-programming
66+
67+
### Exercise 01 hints
68+
69+
- Find first and second comma positions.
70+
- Validate that no field is empty.
71+
72+
### Exercise 02 hints
73+
74+
- Retry on invalid type and zero divisor.
75+
- Continue loop until one valid division is completed.

languages/cpp/02-core/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ This level focuses on robust input handling, common algorithm patterns, and file
2525
- [ ] You can explain at least one edge case for every exercise.
2626
- [ ] You completed capstone project `languages/cpp/projects/02-core`.
2727

28+
Need guidance while solving? Use [HINTS.md](./HINTS.md).
29+
2830
After finishing this level, continue with [03-advanced](../03-advanced/README.md).

languages/cpp/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ module-name/
7373
5. Mark progress in `CHECKLIST.md`.
7474
6. Complete level capstone project in `projects/<level>/`.
7575

76+
## Capstone Projects
77+
78+
Use capstones to combine concepts in a realistic task flow:
79+
80+
- [projects/README.md](./projects/README.md)
81+
82+
## Hint Guides
83+
84+
- [01-foundations/HINTS.md](./01-foundations/HINTS.md)
85+
- [02-core/HINTS.md](./02-core/HINTS.md)
86+
7687
## Build Command
7788

7889
```bash

languages/cpp/projects/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# C++ Capstone Projects
2+
3+
Capstones are level-based projects that combine multiple modules into one practical program.
4+
5+
## Project Order
6+
7+
1. [01-foundations capstone](./01-foundations/README.md)
8+
2. [02-core capstone](./02-core/README.md)
9+
3. [03-advanced capstone](./03-advanced/README.md)
10+
4. [04-expert capstone](./04-expert/README.md)
11+
12+
## How To Use Capstones
13+
14+
1. Complete all concept modules in the matching level first.
15+
2. Read the capstone README requirements.
16+
3. Run the provided `main.cpp`.
17+
4. Extend the project using the extension ideas.
18+
19+
## Build Command
20+
21+
```bash
22+
g++ -std=c++17 -Wall -Wextra -pedantic main.cpp -o capstone
23+
```

languages/python/01-foundations/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This level mirrors the first C++ foundations modules for easy comparison.
88
2. [control-flow](./control-flow/README.md)
99
3. [functions](./functions/README.md)
1010

11+
Track progress in [../CHECKLIST.md](../CHECKLIST.md).
12+
1113
## Study Tip
1214

1315
Solve the same topic in C++ and Python back to back to compare syntax and design choices.

0 commit comments

Comments
 (0)