Skip to content

About

42_examshell – Updated with New Subject Support A practice exam shell for 42 school students to simulate the official exam environment. Now updated with a new subject and exercises through Rank 02, Rank 03, and Rank 04, helping you prepare more effectively for 42 exams. πŸš€ Practice tool to sharpen your skills before the real exam πŸ†• New subject

Resources

Stars

1 star

Watchers

0 watching

Forks

Β 
Β 

Latest commit

Β 

History

72 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

42 Exam Practice Shell

⚑ An interactive practice environment for 42 School exams (Ranks 02-05) ⚑

πŸ“‹ Overview

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.

πŸš€ Features

  • 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 asan command runs your code under AddressSanitizer and UndefinedBehaviorSanitizer
  • Reference answers: solution, plus solution alt for 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

πŸ“ Project Structure

.
β”œβ”€β”€ 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.

πŸ”§ Installation & Usage

git clone https://github.com/hudayiarici/42_examshell
cd 42_examshell
make

Or directly: bash exam.sh

🧭 Menu Options

  • πŸ”„ 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.

⌨️ Commands During Practice

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.

πŸ“š Exam Ranks Covered

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.

πŸ“ Workspace and Backups

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>/.

βš™οΈ Requirements

  • 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.

πŸ™ Credits

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! πŸ€

About

42_examshell – Updated with New Subject Support A practice exam shell for 42 school students to simulate the official exam environment. Now updated with a new subject and exercises through Rank 02, Rank 03, and Rank 04, helping you prepare more effectively for 42 exams. πŸš€ Practice tool to sharpen your skills before the real exam πŸ†• New subject

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages