Exam Rank 02 Github: [new]
More complex logic and math (e.g., add_prime_sum , ft_range ).
#include #include void put_str(char *str, int *len) if (!str) str = "(null)"; while (*str) write(1, str++, 1); (*len)++; void put_digit(long long num, int base, int *len) char *hex = "0123456789abcdef"; if (num < 0) write(1, "-", 1); (*len)++; num = -num; if (num >= base) put_digit(num / base, base, len); write(1, &hex[num % base], 1); (*len)++; int ft_printf(const char *format, ...) va_list args; int len = 0; va_start(args, format); while (*format) if (*format == '%') format++; if (*format == 's') put_str(va_arg(args, char *), &len); else if (*format == 'd') put_digit((long long)va_arg(args, int), 10, &len); else if (*format == 'x') put_digit((long long)va_arg(args, unsigned int), 16, &len); else write(1, format, 1); len++; format++; va_end(args); return (len); Use code with caution. 2. Safe Memory Parsing ( ft_atoi )
If you want a guide on configuring an automated for your code.
The exam system checks for output matching, not structural elegance. Do not over-engineer solutions. To make your repository stand out, let me know:
Most subjects explicitly state: "followed by a newline" . If your program outputs the exact correct string but omits the trailing \n , the grading script will instantly give you a 0. 2. Not Handling NULL Pointers exam rank 02 github
(one from each difficulty level) and must pass all of them within a time limit.
Always compile your practice code using the exact flags Moulinette uses: gcc -Wall -Wextra -Werror main.c ft_problem.c -o test_exec Use code with caution.
Implementing a Reverse Polish Notation stack calculator. Level 4: Linked Lists and Advanced Algorithms
Finding common or unique characters between two strings without duplicates. Level 3: Numbers, Bases, and Memory Allocation More complex logic and math (e
Do not just read the code. You must type it.
ft_range / ft_rrange : Create an array of integers between two points. hidenp : Check if one string is hidden within another.
Shift characters by 13 positions in the alphabet or rotate words within a string. Level 2: String Manipulations and Math
The exam is divided into levels, pulling problems from three primary categories: basic string manipulation, mathematical algorithms, and complex system/data structures. 1. Level 1 & 2: String and Memory Fundamentals Safe Memory Parsing ( ft_atoi ) If you
3 or 4 hours (depending on your specific campus rules).
exam_rank_02/ ├── README.md ├── level_1/ │ ├── ft_putstr/ │ │ └── ft_putstr.c │ └── first_word/ │ └── first_word.c ├── level_2/ │ ├── ft_atoi/ │ │ └── ft_atoi.c │ └── inter/ │ └── inter.c ├── level_3/ │ ├── ft_printf/ │ │ └── ft_printf.c │ └── get_next_line/ │ └── get_next_line.c └── level_4/ ├── flood_fill/ │ └── flood_fill.c └── rostring/ └── rostring.c Use code with caution. Key Elements of a Great Readme
If you’re preparing for Rank 02, here’s a strategy that works: