This is a solution for the exam 06 of the 42 school. I used many different solutions of other people that are incorporated here.
This is the shortest version I have seen so far that is still readable. In theory, you can wrap all the } brackets in one line, but that is unreadable.
It is heavily based on this version, but in general more readable (for me).
I passed with this exact version on 18. January 2024.
- Test multiple line messages
- Test arrival of clients
- Test termination of clients
- Test multiple clients
- Pro Tip: Know your solution letter by letter, remember the first 5 digits of the hash of the file and hash it again to see if it matches. This way you can be sure that you have not written anything wrong. (the md5 command is available in the exam)
Good luck and happy coding!
Understand it if you use the solution. Do not blindly copy it. This will mess you up during the exam, because you will not understand what you are doing.