This repository is intended to help me to learn functions by heart for the 42 exams. It also aims to improve these functions at the same time. For this purpose I developed the following method.
At level one we find tool folder that contains my minimal exam config, the
default 42 vimrc, and debugging tools to quickly check the improvements.
Inside the func directory there is a folder for each function that we can
encounter during the exams.
Inside each of these folder we find the core of the method, three source files:
base.cfunctional starting point, must not be modified.check.cthe improvement file, with annotation and modifications allowed.try.cthis file will be used and reused to code and recode the function by heart. And (optionally) adocandtestfolders.
The workflow is the following:
- recode
base.cfunction intotry.c - debug
try.c - diff
try.candbase.cintocheck.c
HINT Vim users will like
:h vimdiff, thedoand thedpcommands.
LEARN
-
update
check.cwith the mistakes found intry.cand document with aTODOcommentssize_t r; // TODO ssize_t instead of long
IMPROVE
-
update
check.cwith comments that keep a track of mistakes found intry.c, the number preceding theXXX( here2) indicates indicates the number of times the error has been done duringtry.cattempts.static char *temp; // 2 XXX static keyword missing
THUS
Before the exam I can check my most common mistakes using check.c.
After the exam I can improve my function using check.c.