Skip to content

Commit 7cc038e

Browse files
committed
Implement curriculum expansion, capstones, parity track, and build validation
1 parent e453fdc commit 7cc038e

105 files changed

Lines changed: 3465 additions & 494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cpp-build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: C++ Build Matrix
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build-linux:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install g++
15+
run: |
16+
sudo apt update
17+
sudo apt install -y g++
18+
19+
- name: Compile all C++ files
20+
run: bash ./scripts/build-all.sh
21+
22+
build-windows:
23+
runs-on: windows-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup MSYS2
29+
uses: msys2/setup-msys2@v2
30+
with:
31+
update: true
32+
install: >-
33+
mingw-w64-ucrt-x86_64-gcc
34+
35+
- name: Compile all C++ files
36+
shell: msys2 {0}
37+
run: |
38+
./scripts/build-all.sh

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@ Thank you for contributing to this repository.
1919
g++ -std=c++17 -Wall -Wextra -pedantic <file>.cpp -o <output>
2020
```
2121

22+
You can also validate all C++ files with:
23+
24+
- `./scripts/build-all.ps1` (PowerShell)
25+
- `bash ./scripts/build-all.sh` (Bash)
26+
2227
4. Update related README files when behavior or structure changes.
2328
5. Open a pull request with a clear description of what changed and why.
2429

2530
## Content Expectations
2631

2732
- New concept modules should follow the existing folder layout.
33+
- Every concept README should include: `Quick Run`, `Topics Covered`, `Common Pitfalls`, `Exercise Focus`, and `Checkpoint`.
2834
- Every exercise file must contain complete, runnable content.
2935
- Avoid external dependencies and test frameworks for C++ modules.
3036
- Keep examples aligned with C++17.

README.md

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
An educational repository for learning programming languages through focused concepts, runnable examples, and hands-on exercises.
44

5-
The first fully implemented track is **C++ (C++17)**, designed for beginners while following solid coding practices.
5+
The first fully implemented track is **C++ (C++17)**.
6+
Content is designed for VS Code-first workflows and cross-platform execution (Windows MSYS2/MinGW + Linux g++).
67

78
## Project Goals
89

@@ -17,35 +18,27 @@ The first fully implemented track is **C++ (C++17)**, designed for beginners whi
1718
learn-programming-languages-with-examples/
1819
.vscode/ # VS Code tasks and recommendations
1920
templates/ # Reusable concept layout for new modules
21+
scripts/ # Build validation scripts (PowerShell + Bash)
2022
languages/
2123
cpp/ # Active C++ track (implemented)
22-
python/ # Planned track
24+
python/ # Python parity track (foundations started)
2325
go/ # Planned track
2426
csharp/ # Planned track
27+
STUDY_PLAN.md # 4-week guided learning plan
2528
```
2629

27-
Main C++ content lives in `languages/cpp` and is split into numbered modules.
30+
Main C++ content lives in `languages/cpp` and is split into measurable levels:
2831

29-
Current C++ foundations modules:
32+
- `01-foundations`
33+
- `02-core`
34+
- `03-advanced`
35+
- `04-expert`
3036

31-
- `types-and-io`
32-
- `control-flow`
33-
- `functions`
34-
- `arrays-and-vectors`
35-
- `strings`
37+
Python parity starter modules live in `languages/python/01-foundations`:
3638

37-
Current C++ core modules:
38-
39-
- `02-core/input-validation`
40-
- `02-core/algorithms-basics`
41-
42-
Current C++ advanced modules:
43-
44-
- `03-advanced/structs-and-classes`
45-
46-
Current C++ expert modules:
47-
48-
- `04-expert/memory-management-and-raii`
39+
- [`types-and-io`](languages/python/01-foundations/types-and-io/README.md)
40+
- [`control-flow`](languages/python/01-foundations/control-flow/README.md)
41+
- [`functions`](languages/python/01-foundations/functions/README.md)
4942

5043
## Guided Learning Path
5144

@@ -55,9 +48,10 @@ Current C++ expert modules:
5548
- read `README.md`
5649
- run `example/main.cpp`
5750
- solve `exercises/01.cpp` and `exercises/02.cpp`
58-
- after foundations, continue with `languages/cpp/02-core`, then `languages/cpp/03-advanced`, then `languages/cpp/04-expert`
51+
- follow the level order from foundations to expert
5952
4. Mark progress in `languages/cpp/CHECKLIST.md`
60-
5. Repeat until all modules are complete
53+
5. Build capstones in `languages/cpp/projects/`
54+
6. Follow weekly pacing in `STUDY_PLAN.md`
6155

6256
## Compile And Run (C++17)
6357

@@ -90,6 +84,30 @@ VS Code users can also run the included build task in `.vscode/tasks.json` to co
9084
3. Run the task `Run active C++ file` from the command palette (`Tasks: Run Task`).
9185
4. Use `Build and run active C++ file` for one-step iteration while studying exercises.
9286

87+
## Build Validation Scripts
88+
89+
You can compile all C++ examples and exercises with:
90+
91+
PowerShell:
92+
93+
```powershell
94+
./scripts/build-all.ps1
95+
```
96+
97+
Bash:
98+
99+
```bash
100+
bash ./scripts/build-all.sh
101+
```
102+
103+
Both scripts compile each `*.cpp` file under `languages/cpp` with:
104+
105+
```bash
106+
g++ -std=c++17 -Wall -Wextra -pedantic
107+
```
108+
109+
CI also validates this on Linux and Windows in `.github/workflows/cpp-build.yml`.
110+
93111
## Contribution Summary
94112

95113
Contributions are welcome. Please:

STUDY_PLAN.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# 4-Week Study Plan (C++ Track)
2+
3+
This plan assumes 5 study days per week, 60-90 minutes per day.
4+
5+
## Week 1 - Foundations I
6+
7+
- Complete `01-foundations/types-and-io`
8+
- Complete `01-foundations/operators-and-expressions`
9+
- Complete `01-foundations/control-flow`
10+
- Complete `01-foundations/functions`
11+
12+
Deliverables:
13+
14+
- All exercises solved for these modules.
15+
- Notes on at least 3 common input/control-flow mistakes.
16+
17+
## Week 2 - Foundations II + First Capstone
18+
19+
- Complete `01-foundations/arrays-and-vectors`
20+
- Complete `01-foundations/strings`
21+
- Complete `01-foundations/scope-and-lifetime-basics`
22+
- Complete `01-foundations/formatted-output-and-iomanip`
23+
- Build `languages/cpp/projects/01-foundations`
24+
25+
Deliverables:
26+
27+
- All exercises solved.
28+
- Foundations capstone runs from VS Code task flow.
29+
30+
## Week 3 - Core + Core Capstone
31+
32+
- Complete all modules in `02-core`
33+
- Build `languages/cpp/projects/02-core`
34+
35+
Deliverables:
36+
37+
- Core exercises solved.
38+
- Core capstone parses file input and writes output report.
39+
40+
## Week 4 - Advanced + Expert Essentials
41+
42+
- Complete all modules in `03-advanced`
43+
- Complete `04-expert/memory-management-and-raii`
44+
- Complete `04-expert/smart-pointers-in-depth`
45+
- Build `languages/cpp/projects/03-advanced` and `languages/cpp/projects/04-expert`
46+
47+
Deliverables:
48+
49+
- Advanced/expert exercises solved.
50+
- Clear written explanation of ownership and thread safety basics.
51+
52+
## Weekly Review Checklist
53+
54+
- [ ] I can run every module example from terminal and VS Code.
55+
- [ ] I can explain why each exercise solution works.
56+
- [ ] I documented at least 2 bugs/mistakes I fixed this week.
57+
- [ ] I updated `languages/cpp/CHECKLIST.md`.

languages/cpp/00-setup/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,17 @@ Windows (MSYS2 shell):
6666
- Build task compiles the currently open C++ file in place.
6767
- Run task executes the compiled binary from the same folder.
6868
- Combined task builds and runs for faster exercise iteration.
69+
70+
## Build All Examples and Exercises
71+
72+
PowerShell:
73+
74+
```powershell
75+
./scripts/build-all.ps1
76+
```
77+
78+
Bash:
79+
80+
```bash
81+
bash ./scripts/build-all.sh
82+
```
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
# 01 Foundations
22

3-
This section builds the core mental model needed for all later C++ topics.
3+
This level builds the beginner mental model for writing small C++ programs.
44

55
## Module Order
66

77
1. [types-and-io](./types-and-io/README.md)
8-
2. [control-flow](./control-flow/README.md)
9-
3. [functions](./functions/README.md)
10-
4. [arrays-and-vectors](./arrays-and-vectors/README.md)
11-
5. [strings](./strings/README.md)
8+
2. [operators-and-expressions](./operators-and-expressions/README.md)
9+
3. [control-flow](./control-flow/README.md)
10+
4. [functions](./functions/README.md)
11+
5. [arrays-and-vectors](./arrays-and-vectors/README.md)
12+
6. [strings](./strings/README.md)
13+
7. [scope-and-lifetime-basics](./scope-and-lifetime-basics/README.md)
14+
8. [formatted-output-and-iomanip](./formatted-output-and-iomanip/README.md)
1215

13-
Follow this order. Each concept depends on the previous one.
16+
## Level Outcomes
1417

15-
After finishing this section, continue with [02-core](../02-core/README.md).
18+
- Read user input safely and print formatted output.
19+
- Build programs with conditions, loops, and reusable functions.
20+
- Process collections using arrays/vectors and basic string operations.
21+
- Explain variable scope and lifetime in simple programs.
1622

17-
## How To Study
23+
## Done When
1824

19-
For each module:
25+
- [ ] You completed every module in this level.
26+
- [ ] You solved all exercises (`01.cpp` and `02.cpp`) for each module.
27+
- [ ] You can compile each file with `-std=c++17 -Wall -Wextra -pedantic`.
28+
- [ ] You completed capstone project `languages/cpp/projects/01-foundations`.
2029

21-
1. Read `README.md`.
22-
2. Compile and run `example/main.cpp`.
23-
3. Solve `exercises/01.cpp`.
24-
4. Solve `exercises/02.cpp`.
25-
5. Mark progress in `../CHECKLIST.md`.
30+
After finishing this level, continue with [02-core](../02-core/README.md).
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
# Arrays and Vectors
22

3-
This module introduces collections of values and how to process them safely.
3+
This module introduces fixed-size and dynamic collections in C++.
44

5-
## Why This Matters
5+
## Quick Run
66

7-
Real programs rarely use only one variable. You often work with lists of data such as scores, prices, or names.
7+
```bash
8+
g++ -std=c++17 -Wall -Wextra -pedantic example/main.cpp -o arrays_and_vectors_example
9+
./arrays_and_vectors_example
10+
```
811

912
## Topics Covered
1013

11-
### Arrays
12-
13-
- Fixed size, decided at creation time.
14-
- Good for small, known-size data.
14+
- Fixed-size arrays (`T values[N]`).
15+
- Dynamic arrays with `std::vector<T>`.
16+
- Index-based and range-based iteration.
17+
- Safe indexing and input count validation.
1518

16-
```cpp
17-
int scores[3] = {85, 90, 78};
18-
```
19+
## Common Pitfalls
1920

20-
### `std::vector`
21+
- Accessing out-of-range indexes.
22+
- Mixing signed and unsigned indexes carelessly.
23+
- Forgetting to validate `n` before reading values.
2124

22-
- Dynamic size (can grow or shrink).
23-
- Safer and more flexible than raw arrays for beginners.
24-
25-
```cpp
26-
std::vector<int> scores;
27-
scores.push_back(85);
28-
scores.push_back(90);
29-
```
25+
## Exercise Focus
3026

31-
### Iteration
27+
- `exercises/01.cpp`: print user-provided integers in reverse order.
28+
- `exercises/02.cpp`: count frequency of a target number in a vector.
3229

33-
- Index-based loops when you need positions.
34-
- Range-based loops when you only need values.
30+
### Exercise Specs
3531

36-
### Common Pitfalls
32+
1. `exercises/01.cpp`
33+
- Input: integer `n`, then `n` integers.
34+
- Output: values in reverse order.
35+
- Edge cases: `n <= 0` should print a friendly message; repeated values should remain repeated in output.
3736

38-
- Accessing out-of-range indexes (for example, `values[values.size()]`).
39-
- Mixing signed `int` and unsigned `size_t` carelessly.
40-
- Forgetting to validate how many values were read from input.
37+
2. `exercises/02.cpp`
38+
- Input: integer `n`, then `n` integers, then one target integer.
39+
- Output: number of occurrences of target.
40+
- Edge cases: target not found should print `0`; all values equal target should print `n`.
4141

4242
## Checkpoint
4343

44-
- [ ] I understand fixed-size arrays vs dynamic vectors.
45-
- [ ] I can add values to a vector using `push_back`.
46-
- [ ] I can loop through values and compute results.
47-
- [ ] I completed `exercises/01.cpp` and `exercises/02.cpp`.
44+
- [ ] I can choose between arrays and vectors.
45+
- [ ] I can loop over vectors safely.
46+
- [ ] I can solve frequency/counting tasks with vectors.
47+
- [ ] I completed both exercises.

0 commit comments

Comments
 (0)