β‘ An interactive practice environment for 42 School exams (Ranks 02-05) β‘
This project provides a practice shell for 42 School examinations, with interactive menus and exercises for each exam rank. It simulates the exam environment: you get a subject, write your answer in a scratch folder, and a tester compares your output against a reference solution.
- Interactive menu system: colourful terminal interface
- Ranks 02 to 05: every rank has a Level Mode (work through a level at your own pace) and a Real Exam Mode (random subject, you cannot move on until it passes)
- Dedicated workspace: you write in
rendu/, the shell backs it up when you leave - Automated testers: your code is compiled and diffed against a reference
- Leak checking: the
asancommand runs your code under AddressSanitizer and UndefinedBehaviorSanitizer - Reference answers:
solution, plussolution altfor a second, independently written take on the same subject - Turkish subjects: rank 03 and rank 04 subjects carry a
[TURKISH SUBJECT]section under the original text
.
βββ exam.sh # Entry point
βββ Makefile # Runs exam.sh
βββ README.md # This file
βββ rendu/ # Your workspace (git-ignored, wiped between sessions)
βββ trace/ # Backups taken when you leave a practice session
βββ .resources/
βββ main/ # Menus, practice loops, shared helpers
β βββ menu.sh # Entry, sets tester permissions
β βββ level_base.sh # Level Mode loop
β βββ rank0X_*.sh # Per-rank menus and Real Exam Mode loops
β βββ asan_lib.sh # Shared AddressSanitizer helpers
βββ rank02/ # level0 - level3
βββ rank03/ # level1 - level2
βββ rank04/ # level1 - level2
βββ rank05/ # level1 - level2
Each exercise folder holds sub.txt (the subject), a reference solution, tester.sh,
sometimes a main.c harness, an optional asan.sh, and an optional alt/ folder with
an alternative solution.
git clone https://github.com/hudayiarici/42_examshell
cd 42_examshell
makeOr directly: bash exam.sh
- π 1. Commands: in-session command reference
- π 2. Exam Rank 02
- π 3. Exam Rank 03
- π 4. Exam Rank 04
- π 5. Exam Rank 05
- π 6. Open Rendu Folder
Each rank menu then offers Level Mode or Real Exam Mode.
| Command | What it does | Level Mode | Real Exam Mode |
|---|---|---|---|
test |
Compile your code and diff it against the reference | β | β |
asan |
Run under AddressSanitizer + UBSanitizer to catch leaks and undefined behaviour | β | β |
solution |
Print the reference answer | β | β |
solution alt |
Print a second, independently written answer (where one exists) | β | β |
next |
Move on to the next subject | β | β |
menu |
Back up rendu/ and return to the main menu |
β | β |
exit |
Quit | backs up rendu/ |
quits straight away |
asan and solution alt are currently wired up for rank 04. Elsewhere they report
that nothing is available and leave you where you were.
| Rank | Focus | Subjects |
|---|---|---|
| 02 | C fundamentals: strings, bits, lists, sorting | 55 exercises across level0-level3 |
| 03 | Algorithms and backtracking | broken_gnl, filter Β· n_queens, permutations, powerset, rip, tsp |
| 04 | Processes, pipes and parsing | ft_popen, picoshell Β· vbc |
| 05 | C++ and object-oriented design | bigint, polyset, vect2 Β· bsq, life |
Rank 04 is narrowed to the subjects that actually come up in the exam. sandbox and
argo are still on disk but out of rotation; add them back to the pools in
.resources/main/level_base.sh and .resources/main/rank04_exam_mode.sh if you want
them.
You write your answers under rendu/<subject>/. The folder is recreated on every run,
so it is git-ignored and never holds anything permanently.
When you leave a session with exit or menu, rendu/ is copied to
trace/rendu_backup_<timestamp>/ before being cleared. Finishing a full Real Exam Mode
run for rank 04 or rank 05 instead backs up to exam/rendu_backup_<timestamp>/.
- Bash and a Unix-like system (Linux or macOS)
gccβ testers build with-Wall -Wextra -Werror- Terminal with colour support (recommended)
The asan command needs a gcc with AddressSanitizer, which is the default on
Linux and macOS. It stands in for valgrind, which will not run on Arch-based
systems without glibc debug symbols.
Forked from terminal-42s/42_examshell.
The alternative solutions under alt/ are copied from
suatkvam/exam-4 and are not our own work. See
.resources/rank04/ALT_SOLUTIONS.md.
Good luck with your exams! π