Skip to content

TimEtOff/Piscine42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

246 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Piscine 42 Lyon - July 2025

As you may know, 42 School resolves around projects instead of classes with professors. It's the same during the Piscine, and the pisciners are insinde the school for a month where they need to complete projects and take exams under the school's pedagogy. At the end of the Piscine, the Bocal (Staff) will send the result of the admission to everybody at the same time within 2 weeks.
During the Piscine, I pushed almost everything I did in this repository when I pushed in 42's repos at the same time with some custom scripts (check out /scripts).

For your Piscine, I would recommend the improved intra browser extension to add features on the intra, like a custom background on your profile.
I'd recommend also these extensions for VS Code if you use it:
VSCode extensions

Cheating is obviously forbidden, and you shouldn't use this repo to copy-paste any code for your Piscine. (Note that even if you don't use the code, and only look at this README, it could be taken as cheating and I don't recommend you to use this repo at all during your Piscine)

Results

I finished with C 09 completed (average around C 07-08), pretty good scores on the exams, not on the Rushes but it's the hardest so it's okay, and a nice working BSQ but with some 'eliminating' errors so a low score (same as 90% of groups).
Projects on the intra (before the Final Exam)

On the Holy Graph:
Holy Graph (before the Final Exam)

Finished with a level 9 (average around 7-8).
Level 9 - 12%

I spent a total of 183 hours on 42's computers, with an average of 50 hours per week.
Logtime

I was quite happy with my results but unfortunately I was not admitted into the school after this Piscine, despite having good scores on the projects, I was probably not involved enough on the social side.

Projects

Projects are the main thing in the piscine. There is firstly 2 Shell projects to learn the basics of terminal commmands to navigate on the computers, and then the main 14 C projects.
Every projects need to have a grade of 50 or greater to validated. To evaluate a project, you first need to do 2 peer-to-peer evaluations with other pisciners, and then the Moulinette, a program, will run tests on your code. Your code need to sitck to the Norm, tested by the Norminette (available with norminette command on all 42's computers, or on this repo), as well as all the rules on the subject (read again the subject before closing, I did the error a few times). When the Moulinette is evaluating, if an exercise doesn't work, every next exercise, even when right, doesn't count. After each Moulinette passage, you can find a trace in your emails that can be (sometimes) useful when debugging.

You can find here all my projects and results, as well as all Moulinette's results, details of what should be wrong, and a link to the the commit of the try.

Shell 00  |success: 100/100|

Grade Moulinette Notes Submit commit
First try fail: 10/100
ex00: OK ∣ ex01: OK ∣ 
ex02: KO ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: KO ∣ ex07: OK ∣ 
ex08: Nothing turned in ∣ 
ex09: Nothing turned in
  • ex02: Forgot physical links between 3 and 5 + Wrong timestamp on 6
  • ex06: Wrong command
<b8232d3>
Retry 1 success: 100/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: OK ∣ ex07: OK ∣ 
ex08: OK ∣ ex09: KO
  • ex09: Should display 42 file instead of 42 File, fixed in <main>, not tested.
<b48c470>

See subject

Basic shell commands to understand how the computer and files work, and learning to navigate them only via terminal.

Shell 01  |success: 70/100|

Grade Moulinette Notes Submit commit
First try success: 70/100
ex01: OK ∣ ex02: OK ∣ 
ex03: OK ∣ ex04: OK ∣ 
ex05: OK ∣ ex06: OK ∣ 
ex07: KO ∣ ex08: KO
  • ex07: Worked in my tests but didn't with in evaluations. sed expression should be in quotes and not {}, fixed in <main>, not tested.
  • ex08: Tried but did not finish.
<5e9358a>

See subject

Harder shell commands and scripts that can be quite complex.


C 00         |success: 67/100|

Grade Moulinette Notes Submit commit
First try success: 67/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: Does not compile ∣ 
ex07: KO ∣ 
ex08: Does not compile
  • ex06: The include for write was commented
  • ex07: Forgot about negative numbers
  • ex08: Abandonned

Ex06 and 07 fixed in <main>, not tested
<5d84fe9>

See subject

To learn the basics of C languague, mainly with the write function (unistd.h), chars and ints.

C 01         |success: 100/100|

Grade Moulinette Notes Submit commit
First try success: 100/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: OK ∣ ex07: OK ∣ 
ex08: OK
Perfect
Notes: tests in ex08 are wrong but are working, fixed in <main>
<7d80b5a>

See subject

The first time we use pointers and learn about them.

C 02         |success: 100/100|

Grade Moulinette Notes Submit commit
First try fail: 5/100
ex00: OK ∣ ex01: KO ∣ 
ex02: KO ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: OK ∣ ex07: OK ∣ 
ex08: OK ∣ ex09: KO ∣ 
ex10: KO ∣ ex11: KO ∣ 
ex12: KO
  • ex01: Should fill empty characters with null-terminators \0
  • ex02: Read the subject as "alphanumeric" but was actually only alpha
  • ex09: Misread the subject, other letters should all be lowercase
  • ex10: Idk
  • ex11: Should be able to handle unsigned chars (extended ASCII table)
  • ex12: Same as ex11
Notes: Should be fixed in <main>, not tested.
<7b869bb>
Retry 1 fail: 5/100
ex00: OK ∣ ex01: KO ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: OK ∣ ex07: OK ∣ 
ex08: OK ∣ ex09: OK ∣ 
ex10: OK ∣ ex11: OK ∣ 
ex12: KO
  • ex01: No idea
  • ex12: No idea
<885529a>
Retry 2 success: 100/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: OK ∣ ex07: OK ∣ 
ex08: OK ∣ ex09: OK ∣ 
ex10: OK ∣ ex11: OK ∣ 
ex12: KO
  • ex12: No idea but was passed because of 100% on both peer-to-peer evaluations
<7f059f4>

See subject

Basic string manipulation with copy or detection of certain types of characters. Lot of copy-paste. Understanding the functions that we need to copy is hard at first, and you should really pay attention to everything in the subject and the man.

C 03         |success: 50/100|

Grade Moulinette Notes Submit commit
First try fail: 10/100
ex00: OK ∣ ex01: KO ∣ 
ex02: OK ∣ ex03: KO ∣ 
ex04: KO ∣ ex05: KO
  • ex01: [SegFault] Probably pointers
  • ex03: Null-terminators (see c02 first try) or pointers
  • ex04: Idk, probably pointers
  • ex05: Didn't really understand strlcat
<20565f8>
Retry 1 success: 50/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: KO ∣ ex05: OK
  • ex04: No idea
<6ce8546>

See subject

More advanced string manipulation but many times the same function with only some slight variations.

C 04         |success: 70/100|

Grade Moulinette Notes Submit commit
First try fail: 40/100
ex00: OK ∣ ex01: OK ∣ 
ex02: KO ∣ ex03: KO ∣ 
ex04: KO ∣ ex05: KO
  • ex02: Didn't cast number into long so INT_MIN overflowed
  • ex03: Should consider any whitespace instead of only classic space
  • ex04: Shouldn't add a new line at the end of the number
  • ex05: Same as ex03 (atoi)
<4ab1050>
Retry 1 success: 70/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: KO ∣ ex05: KO
  • ex04: Didn't write if nbr == 0 in recursive_write
  • ex05: Base should be invalid with whitespaces too
Notes: Fixed in <main>, not tested
<758e64d>

See subject

String to int, int to string and base manipulation.

C 05         |success: 100/100|

Grade Moulinette Notes Submit commit
First try fail: 0/100
ex00: KO ∣ ex01: KO ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: OK ∣ ex07: OK ∣ 
ex08: OK
  • ex00 and ex01: Didn't check for nb <= 0
<55199b0>
Retry 1 success: 100/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK ∣ 
ex06: OK ∣ ex07: OK ∣ 
ex08: OK
Perfect <298c26b>

See subject

Learn the difference between iterative and recursive functions, and use them. Ex08: See The Ten Queens Puzzle

C 06         |success: 85/100|

Grade Moulinette Notes Submit commit
First try success: 85/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: KO
  • ex03: My sort algorithm wasn't good, fixed in <main>
<73ee320>

See subject

Start to make programs instead of functions, and use arguments on main function.

C 07         |success: 100/100|

Grade Moulinette Notes Submit commit
First try fail: 15/100
ex00: OK ∣ ex01: KO ∣ 
ex02: KO ∣ ex03: OK ∣ 
ex04: KO ∣ ex05: KO
  • ex01 & 02: Should check if min >= max instead of min > max
  • ex04: base_from wasn't properly checked
  • ex05: I don't really know, a lot of valgrind errors, ended up redoing it entirely
<aee357b>
Retry 1 fail: 30/100
ex00: OK ∣ ex01: OK ∣ 
ex02: KO ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK
  • ex02: I don't know how to read, if min >= max, the program should return 0 instead of -1 (-1 in case of error)
<26e26fd>
Retry 2 success: 100/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK
Perfect <a38ab93>

See subject

Learn how to use tha malloc and free functions to allocate memory.

C 08         |success: 100/100|

Grade Moulinette Notes Submit commit
First try success: 100/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK ∣ ex03: OK ∣ 
ex04: OK ∣ ex05: OK
<2c2455a>

See subject

Use header files (.h) and structures struct + typedef.

C 09         |success: 100/100|

Grade Moulinette Notes Submit commit
First try fail: 0/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK
Everything worked great but I didn't know about the Norm in Makefiles, the 'output' file variable should be names NAME instead of EXE <b057384>
Retry 1 success: 100/100
ex00: OK ∣ ex01: OK ∣ 
ex02: OK
Perfect <1703533>

See subject

Learn about advanced compiling and Makefiles.


BSQ       |fail: 16/100|

Grade Submit commit
fail: 16/100 <d5db5bb>

*With yriffard

See subject (FR) (EN - old)

The BSQ is the last project of the piscine. It consists of using almost everythings we learned during the month.
You should at least know (not necessarily validated) the notions up to C10.
In this project, you need to find the Biggest SQuare on a map from a file, where this map has empty places and obsacles.
You should be able to handle errors on the map if it doesn't follow the rules, handle multiple maps on the same run if there is multiple inputs (C06), make sure there are no memory leak (C07), have a working Makefile (C09) and many others notions.

Errors we know about:

  • In case of map error, everything is not freed correctly.
  • With stdin:
    • Should work with a ./bsq < [map_file] or cat [map_file] | ./bsq command (not stated by the subject)
    • We use duplicates that we forgot to free
    • If the map doesn't start at the first input lines, it won't work
    • Errors are not handled
    • Parsing works but doesn't return a map error if needed
    • (Buffer has a size limit of 1024)

Moulinette:

basic_tests: One parameter KO | functional_tests: Test 1 KO

Details:

  • One parameter KOed because we separate each argument with a new line for lisibility, as it's how we understood the subject.
  • functional_tests: Test 1 is probably the standard input.

Evaluations:

"Tres bien ! Tout est parfait, bonne gestion des erreurs ! Attention le code n'est pas des plus opti mais ca devrait suffir ! Le 10kx10k tourne en 40s c'est bien je pense ! Code facile clair et explications aussi ! Le code est solide aucun de mes tests ne l'a fait flancher ! Bonne chance et bon courage pour l'exam demain !!! ;D Canine" (100%) - hbretagn

"Un très bon projet, bien organisé et réparti. Le code est propre et très bien expliqué, et tout semble fonctionnel, aurait pu mériter un 100. Dommage pour la mauvaise compréhension de l'entrée standard qui peut prêter à confusion dans le sujet (prends dans l'entrée si on lui donne le contenu du fichier et non le fichier en lui-même comme dit dans la correction). bravo a vous et bon courage pour la fin de piscine et l'examen." (0%) - clemmart

"C est un super projet, vous vous etes tres bien organisé et repartis le travail comme le prouve le git log, vous avez su m expliquer votre code, un code qui est d ailleurs tres clair et modulaire. Votre gestion des erreurs est tres solide, dommage pour l entree standard, le pdf n etait pas clair sur le sujet. Bonne continuation et pour courage pour l exam final !!" (0%) - mberthai


Exams

Exams are, as you can guess, exams. They take place for 4 hours, the Fridays from 4PM to 8PM. You are free to finish whenever you want.

During the exam, you are alone on the computer, you cannot use the internet, your previous projects nor speak with the others. You can have a blank paper and a pen to take notes.

Even though you can use whatever text editor/IDE you want on the projects, in exam, you can only use the Terminal, Vim, Emacs & Nano, so be sure to remember everything you think will be useful, or at least know where to search.

Exam 00

First exam at the end of the first week. Should be relatively easy and revolves mainly around the write function in C and the notions in C00 and C01.
As I not enough prepared, I completely froze on the first exercise, it was really easy, just print a character with the write function, but I didn't know the name of the library to include (unistd.h), and after two hours of tries and labor, I finally abandonned, that resulted in this grade (yes it's considered as a success anyway for whatever reason):
Projects notions: shell00, c00-01/02?

success: 0/100

Exam 01

Mainly about string manipulation, still the write function and arguments in the main function (argc, argv).
Was pretty easy even tough not everyone went to c06 at the time, so plenty of people din't know how to handle arguments.
Projects notions: exam00, c02-c06

success: 100/100

Exam 02

Same as exam01 but with malloc too.
Took more time on some exercises and didn't have time to finish the last one. My code worked great except in one particular case but I couldn't fix it in time. Projects notions: exam01, c07

success: 90/100

Final Exam

Last exam during 8 hours.


Projects notions: Near everything, including BSQ

success: 90/100

Rushs

Rushs are projects in randomly generated groups, where you need to work in cooperation to complete your subject.

There will be only one correction, not by other pisciners but by members of the staff, and every member of the group should know how to explain the program clearly, as it will be graded "in particular on the group's least solid explanations".

Rush 00

Grade Notes Submit commit
fail: 0/100 Everything worked great but we got flagged for the Norm because of the commented main test function in ft_putchar.c (only copy-pasted it from C 00). <73badae>

Evaluation

"Projet fonctionnel avec tous les sujets (bonus) fait. Le code est pas mal, avec des bonnes idees! Quelques petits points d'ameliorations pas tres importants auraient pu etre applique mais rien de tres ouf. Attention a la norme, lisez le pdf, la norminette ne check pas tout! Bon courrage pour la suite!" - lcottet

With dbeal and talbart

See subject

[Project description here]


Rush 01

Grade Notes Submit commit
fail: 0/100 We didn't finish the project and a lot of things were wrongly done, we didn't expect more. <2cb6ec8>

Evaluation

"Début de projets : plein d’idées, une bonne logique de backtrak et de récursivité, les explications sont bien faites, à part ça rien à redire.

Problèmes : malloc mal sécurisé/inutile, la remontée d’erreur peut etre meilleur , utilisation de variables globales inutiles, lire la norme, les commits en français, le programme alloue avant de checker le parsing, pas mal de bouts de scotch (chiffres « magique »), mais une bonne résilience, vous avez essayé jusqu’au bout. Bon courage pour la piscine !" - pnaessen

With tgonthie and cobussie

See subject

https://www.puzzle-skyscrapers.com [Project description here]


Rush 02

Grade Notes Submit commit
fail: 0/100 Almost everything worked great but we didn't have time to fuse our work and norm it correclty. <d2ecdbc>

Evaluation

"Très bon groupe, un bon début de projet qui fonctionne avec 3 chiffres. Les nouvelles notions sont comprises : makefile, open, close, fd. Malheureusement, quelques petits soucis : malloc pas forcément sécurisé, open aussi, des soucis de norm. Mais sinon, l'idée de l'algo était très bonne, tout le monde a bien travaillé dessus. Avec une journée de plus, cela aurait pu être validé. Oubliez le PHONY + relink. Bonne chance pour la fin de piscine !" - pnaessen

With mboutte and nlaponte

See subject

[Project description here]


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors