bastien 4 mesi fa
parent
commit
580a8d6da2
63 ha cambiato i file con 1180 aggiunte e 0 eliminazioni
  1. BIN
      Module_01/ex00/.objects/Zombie.o
  2. BIN
      Module_01/ex00/.objects/main.o
  3. BIN
      Module_01/ex00/.objects/newZombie.o
  4. BIN
      Module_01/ex00/.objects/randomChump.o
  5. BIN
      Module_01/ex00/.objects/zombieHorde.o
  6. 50 0
      Module_01/ex00/Makefile
  7. BIN
      Module_01/ex00/ex00
  8. 30 0
      Module_01/ex00/includes/Zombie.hpp
  9. 36 0
      Module_01/ex00/srcs/Zombie.cpp
  10. 27 0
      Module_01/ex00/srcs/main.cpp
  11. 17 0
      Module_01/ex00/srcs/newZombie.cpp
  12. 20 0
      Module_01/ex00/srcs/randomChump.cpp
  13. 25 0
      Module_01/ex00/srcs/zombieHorde.cpp
  14. BIN
      Module_01/ex01/.objects/Zombie.o
  15. BIN
      Module_01/ex01/.objects/main.o
  16. BIN
      Module_01/ex01/.objects/newZombie.o
  17. BIN
      Module_01/ex01/.objects/randomChump.o
  18. BIN
      Module_01/ex01/.objects/zombieHorde.o
  19. 50 0
      Module_01/ex01/Makefile
  20. BIN
      Module_01/ex01/ex00
  21. 30 0
      Module_01/ex01/includes/Zombie.hpp
  22. 36 0
      Module_01/ex01/srcs/Zombie.cpp
  23. 27 0
      Module_01/ex01/srcs/main.cpp
  24. 17 0
      Module_01/ex01/srcs/newZombie.cpp
  25. 20 0
      Module_01/ex01/srcs/randomChump.cpp
  26. 25 0
      Module_01/ex01/srcs/zombieHorde.cpp
  27. BIN
      Module_01/ex02/.objects/main.o
  28. 50 0
      Module_01/ex02/Makefile
  29. BIN
      Module_01/ex02/ex00
  30. 30 0
      Module_01/ex02/srcs/main.cpp
  31. BIN
      Module_01/ex03/.objects/HumanA.class.o
  32. BIN
      Module_01/ex03/.objects/HumanB.class.o
  33. BIN
      Module_01/ex03/.objects/Weapon.class.o
  34. BIN
      Module_01/ex03/.objects/main.o
  35. 50 0
      Module_01/ex03/Makefile
  36. BIN
      Module_01/ex03/ex00
  37. 31 0
      Module_01/ex03/includes/HumanA.class.hpp
  38. 32 0
      Module_01/ex03/includes/HumanB.class.hpp
  39. 30 0
      Module_01/ex03/includes/Weapon.class.hpp
  40. 27 0
      Module_01/ex03/srcs/HumanA.class.cpp
  41. 32 0
      Module_01/ex03/srcs/HumanB.class.cpp
  42. 30 0
      Module_01/ex03/srcs/Weapon.class.cpp
  43. 35 0
      Module_01/ex03/srcs/main.cpp
  44. BIN
      Module_01/ex03/weapon.tar.gz
  45. BIN
      Module_01/ex04/.objects/main.o
  46. 50 0
      Module_01/ex04/Makefile
  47. BIN
      Module_01/ex04/ex00
  48. 34 0
      Module_01/ex04/srcs/main.cpp
  49. 34 0
      Module_01/ex04/srcs/main.cpp.replace
  50. BIN
      Module_01/ex05/.objects/harl.class.o
  51. BIN
      Module_01/ex05/.objects/main.o
  52. 50 0
      Module_01/ex05/Makefile
  53. BIN
      Module_01/ex05/ex00
  54. 30 0
      Module_01/ex05/includes/harl.class.hpp
  55. 45 0
      Module_01/ex05/srcs/harl.class.cpp
  56. 20 0
      Module_01/ex05/srcs/main.cpp
  57. BIN
      Module_01/ex06/.objects/harl.class.o
  58. BIN
      Module_01/ex06/.objects/main.o
  59. 50 0
      Module_01/ex06/Makefile
  60. BIN
      Module_01/ex06/ex00
  61. 32 0
      Module_01/ex06/includes/harl.class.hpp
  62. 50 0
      Module_01/ex06/srcs/harl.class.cpp
  63. 28 0
      Module_01/ex06/srcs/main.cpp

BIN
Module_01/ex00/.objects/Zombie.o


BIN
Module_01/ex00/.objects/main.o


BIN
Module_01/ex00/.objects/newZombie.o


BIN
Module_01/ex00/.objects/randomChump.o


BIN
Module_01/ex00/.objects/zombieHorde.o


+ 50 - 0
Module_01/ex00/Makefile

@@ -0,0 +1,50 @@
+#******************************************************************************#
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#*   Updated: 2025/07/15 14:44:55 by bchanot          ###   ########.fr       *#
+#                                                                              #
+#******************************************************************************#
+
+NAME = ex00
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main Zombie zombieHorde randomChump newZombie
+SRCS = $(FILES)
+OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRCS)))
+RED = \033[1;31m
+BLUE = \033[1;34m
+CYAN = \033[0;36m
+GREEN = \033[1;32m
+YELLOW = \033[1;33m
+EOC = \033[0m
+
+all: $(NAME)
+
+$(NAME): $(OBJS)
+	@echo -e "$(GREEN)Objects created.$(EOC)"
+	@$(CC) $(OBJS) $(INC) -o $(NAME)
+	@echo -e "$(GREEN)Compilation complete.$(EOC)"
+
+$(OBJS_DIR)%.o: $(SRCS_DIR)%.cpp
+	@mkdir -p $(dir $@)
+	$(CC) -c $< $(INC) -o $@
+
+clean:
+	@echo -e "$(RED)Deleting objects.$(EOC)"
+	@/bin/rm -rf $(OBJS_DIR)
+
+fclean: clean
+	@echo -e "$(RED)Deleting binary.$(EOC)"
+	@/bin/rm -rf $(NAME)
+
+re: fclean all
+
+.PHONY: all clean fclean re

BIN
Module_01/ex00/ex00


+ 30 - 0
Module_01/ex00/includes/Zombie.hpp

@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Zombie.hpp                                         :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:42:27 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:47:35 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include <iostream>
+
+class	Zombie {
+	public:
+		Zombie(std::string name);
+		Zombie(void);
+		~Zombie(void);
+
+		void	announce(void) const;
+		void	setZombie(std::string name);
+
+	private:
+		std::string	_name;
+};
+
+Zombie	*newZombie( std::string name);
+void	randomChump( std::string name );
+Zombie	*zombieHorde( int N, std::string name );

+ 36 - 0
Module_01/ex00/srcs/Zombie.cpp

@@ -0,0 +1,36 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Zombie.cpp                                         :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:44:24 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:48:08 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+#include <iostream>
+
+Zombie::Zombie(std::string name) : _name(name) {
+	std::cout << "Constructor of " << name << "called" << std::endl;
+	return ;
+}
+
+Zombie::Zombie(void) : _name("defaultName") {
+	std::cout << "Constructor of " << this->_name << "called" << std::endl;
+	return ;
+}
+Zombie::~Zombie(void) {
+	std::cout << "Destructor of " << this->_name << "called" << std::endl;
+	return ;
+}
+
+void	Zombie::announce(void) const {
+	std::cout << this->_name << ": BraiiiiiiiinnnnzzzzZ..." << std::endl;
+}
+
+void	Zombie::setZombie(std::string name) {
+	this->_name = name;
+}

+ 27 - 0
Module_01/ex00/srcs/main.cpp

@@ -0,0 +1,27 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 14:30:32 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:50:07 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+#include <iostream>
+
+int	main(void) {
+	
+	randomChump("testouille");
+	Zombie *ZombieTest = newZombie("tameouilr");
+
+	delete(ZombieTest);
+	ZombieTest = zombieHorde(4, "tameouilr2121");
+	for (int i = 0; i < 4; i++)
+		ZombieTest[i].announce();
+	delete [] ZombieTest;
+	return 0;
+}

+ 17 - 0
Module_01/ex00/srcs/newZombie.cpp

@@ -0,0 +1,17 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   newZombie.cpp                                      :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:51:00 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 13:56:23 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+
+Zombie	*newZombie(std::string name) {
+	return new	Zombie(name);
+}

+ 20 - 0
Module_01/ex00/srcs/randomChump.cpp

@@ -0,0 +1,20 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   randomChump.cpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:56:38 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 13:58:18 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+
+void	randomChump(std::string name) {
+	Zombie	zombie(name);
+
+	zombie.announce();
+	return ;
+}

+ 25 - 0
Module_01/ex00/srcs/zombieHorde.cpp

@@ -0,0 +1,25 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   zombieHorde.cpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:58:41 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:30:26 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+
+Zombie	*zombieHorde(int N, std::string name) {
+	Zombie *zombies = new Zombie[N];
+	int i;
+
+	i = 0;
+	while (i < N) {
+		zombies[i].setZombie(name);
+		i++;
+	}
+	return zombies;
+}

BIN
Module_01/ex01/.objects/Zombie.o


BIN
Module_01/ex01/.objects/main.o


BIN
Module_01/ex01/.objects/newZombie.o


BIN
Module_01/ex01/.objects/randomChump.o


BIN
Module_01/ex01/.objects/zombieHorde.o


+ 50 - 0
Module_01/ex01/Makefile

@@ -0,0 +1,50 @@
+#******************************************************************************#
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#*   Updated: 2025/07/15 14:44:55 by bchanot          ###   ########.fr       *#
+#                                                                              #
+#******************************************************************************#
+
+NAME = ex00
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main Zombie zombieHorde randomChump newZombie
+SRCS = $(FILES)
+OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRCS)))
+RED = \033[1;31m
+BLUE = \033[1;34m
+CYAN = \033[0;36m
+GREEN = \033[1;32m
+YELLOW = \033[1;33m
+EOC = \033[0m
+
+all: $(NAME)
+
+$(NAME): $(OBJS)
+	@echo -e "$(GREEN)Objects created.$(EOC)"
+	@$(CC) $(OBJS) $(INC) -o $(NAME)
+	@echo -e "$(GREEN)Compilation complete.$(EOC)"
+
+$(OBJS_DIR)%.o: $(SRCS_DIR)%.cpp
+	@mkdir -p $(dir $@)
+	$(CC) -c $< $(INC) -o $@
+
+clean:
+	@echo -e "$(RED)Deleting objects.$(EOC)"
+	@/bin/rm -rf $(OBJS_DIR)
+
+fclean: clean
+	@echo -e "$(RED)Deleting binary.$(EOC)"
+	@/bin/rm -rf $(NAME)
+
+re: fclean all
+
+.PHONY: all clean fclean re

BIN
Module_01/ex01/ex00


+ 30 - 0
Module_01/ex01/includes/Zombie.hpp

@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Zombie.hpp                                         :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:42:27 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:47:35 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include <iostream>
+
+class	Zombie {
+	public:
+		Zombie(std::string name);
+		Zombie(void);
+		~Zombie(void);
+
+		void	announce(void) const;
+		void	setZombie(std::string name);
+
+	private:
+		std::string	_name;
+};
+
+Zombie	*newZombie( std::string name);
+void	randomChump( std::string name );
+Zombie	*zombieHorde( int N, std::string name );

+ 36 - 0
Module_01/ex01/srcs/Zombie.cpp

@@ -0,0 +1,36 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Zombie.cpp                                         :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:44:24 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:48:08 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+#include <iostream>
+
+Zombie::Zombie(std::string name) : _name(name) {
+	std::cout << "Constructor of " << name << "called" << std::endl;
+	return ;
+}
+
+Zombie::Zombie(void) : _name("defaultName") {
+	std::cout << "Constructor of " << this->_name << "called" << std::endl;
+	return ;
+}
+Zombie::~Zombie(void) {
+	std::cout << "Destructor of " << this->_name << "called" << std::endl;
+	return ;
+}
+
+void	Zombie::announce(void) const {
+	std::cout << this->_name << ": BraiiiiiiiinnnnzzzzZ..." << std::endl;
+}
+
+void	Zombie::setZombie(std::string name) {
+	this->_name = name;
+}

+ 27 - 0
Module_01/ex01/srcs/main.cpp

@@ -0,0 +1,27 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 14:30:32 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:50:07 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+#include <iostream>
+
+int	main(void) {
+	
+	randomChump("testouille");
+	Zombie *ZombieTest = newZombie("tameouilr");
+
+	delete(ZombieTest);
+	ZombieTest = zombieHorde(4, "tameouilr2121");
+	for (int i = 0; i < 4; i++)
+		ZombieTest[i].announce();
+	delete [] ZombieTest;
+	return 0;
+}

+ 17 - 0
Module_01/ex01/srcs/newZombie.cpp

@@ -0,0 +1,17 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   newZombie.cpp                                      :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:51:00 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 13:56:23 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+
+Zombie	*newZombie(std::string name) {
+	return new	Zombie(name);
+}

+ 20 - 0
Module_01/ex01/srcs/randomChump.cpp

@@ -0,0 +1,20 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   randomChump.cpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:56:38 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 13:58:18 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+
+void	randomChump(std::string name) {
+	Zombie	zombie(name);
+
+	zombie.announce();
+	return ;
+}

+ 25 - 0
Module_01/ex01/srcs/zombieHorde.cpp

@@ -0,0 +1,25 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   zombieHorde.cpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 13:58:41 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 14:30:26 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Zombie.hpp"
+
+Zombie	*zombieHorde(int N, std::string name) {
+	Zombie *zombies = new Zombie[N];
+	int i;
+
+	i = 0;
+	while (i < N) {
+		zombies[i].setZombie(name);
+		i++;
+	}
+	return zombies;
+}

BIN
Module_01/ex02/.objects/main.o


+ 50 - 0
Module_01/ex02/Makefile

@@ -0,0 +1,50 @@
+#******************************************************************************#
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#*   Updated: 2025/07/15 15:14:26 by bchanot          ###   ########.fr       *#
+#                                                                              #
+#******************************************************************************#
+
+NAME = ex00
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main
+SRCS = $(FILES)
+OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRCS)))
+RED = \033[1;31m
+BLUE = \033[1;34m
+CYAN = \033[0;36m
+GREEN = \033[1;32m
+YELLOW = \033[1;33m
+EOC = \033[0m
+
+all: $(NAME)
+
+$(NAME): $(OBJS)
+	@echo -e "$(GREEN)Objects created.$(EOC)"
+	@$(CC) $(OBJS) $(INC) -o $(NAME)
+	@echo -e "$(GREEN)Compilation complete.$(EOC)"
+
+$(OBJS_DIR)%.o: $(SRCS_DIR)%.cpp
+	@mkdir -p $(dir $@)
+	$(CC) -c $< $(INC) -o $@
+
+clean:
+	@echo -e "$(RED)Deleting objects.$(EOC)"
+	@/bin/rm -rf $(OBJS_DIR)
+
+fclean: clean
+	@echo -e "$(RED)Deleting binary.$(EOC)"
+	@/bin/rm -rf $(NAME)
+
+re: fclean all
+
+.PHONY: all clean fclean re

BIN
Module_01/ex02/ex00


+ 30 - 0
Module_01/ex02/srcs/main.cpp

@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 14:57:39 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 15:14:56 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include <iostream>
+
+int main(void) {
+	std::string	str = "HI THIS IS BRAIN";
+
+	std::string	*stringPTR = &str;
+	std::string	&stringREF = str;
+
+	std::cout << &str << " | str address" << std::endl;
+	std::cout << &stringPTR << " | stringPTR address" << std::endl;
+	std::cout << &stringREF << " | stringREF address" << std::endl;
+
+
+	std::cout << str << "| str value" << std::endl;
+	std::cout << *stringPTR << "| stringPTR value" << std::endl;
+	std::cout << stringREF << "| stringVAR value" << std::endl;
+	return 0;
+}

BIN
Module_01/ex03/.objects/HumanA.class.o


BIN
Module_01/ex03/.objects/HumanB.class.o


BIN
Module_01/ex03/.objects/Weapon.class.o


BIN
Module_01/ex03/.objects/main.o


+ 50 - 0
Module_01/ex03/Makefile

@@ -0,0 +1,50 @@
+#******************************************************************************#
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#*   Updated: 2025/07/15 16:12:37 by bchanot          ###   ########.fr       *#
+#                                                                              #
+#******************************************************************************#
+
+NAME = ex00
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main HumanA.class HumanB.class Weapon.class
+SRCS = $(FILES)
+OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRCS)))
+RED = \033[1;31m
+BLUE = \033[1;34m
+CYAN = \033[0;36m
+GREEN = \033[1;32m
+YELLOW = \033[1;33m
+EOC = \033[0m
+
+all: $(NAME)
+
+$(NAME): $(OBJS)
+	@echo -e "$(GREEN)Objects created.$(EOC)"
+	@$(CC) $(OBJS) $(INC) -o $(NAME)
+	@echo -e "$(GREEN)Compilation complete.$(EOC)"
+
+$(OBJS_DIR)%.o: $(SRCS_DIR)%.cpp
+	@mkdir -p $(dir $@)
+	$(CC) -c $< $(INC) -o $@
+
+clean:
+	@echo -e "$(RED)Deleting objects.$(EOC)"
+	@/bin/rm -rf $(OBJS_DIR)
+
+fclean: clean
+	@echo -e "$(RED)Deleting binary.$(EOC)"
+	@/bin/rm -rf $(NAME)
+
+re: fclean all
+
+.PHONY: all clean fclean re

BIN
Module_01/ex03/ex00


+ 31 - 0
Module_01/ex03/includes/HumanA.class.hpp

@@ -0,0 +1,31 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   HumanA.class.hpp                                   :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 15:37:01 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 18:13:28 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef HUMANA_CLASS_H
+#define HUMANA_CLASS_H
+
+#include <iostream>
+#include "Weapon.class.hpp"
+
+class	HumanA {
+	public:
+		HumanA(std::string name, Weapon &weapon);
+		~HumanA(void);
+
+		void	attack(void) const;
+
+	private:
+		std::string	_name;
+		Weapon		&_weapon;
+};
+
+#endif

+ 32 - 0
Module_01/ex03/includes/HumanB.class.hpp

@@ -0,0 +1,32 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   HumanB.class.hpp                                   :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 15:37:01 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 18:12:13 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef HUMANB_CLASS_H
+#define HUMANB_CLASS_H
+
+#include <iostream>
+#include "Weapon.class.hpp"
+
+class	HumanB {
+	public:
+		HumanB(std::string name);
+		~HumanB(void);
+
+		void	attack(void) const;
+		void	setWeapon(Weapon &weapon);
+
+	private:
+		std::string	_name;
+		Weapon		*_weapon;
+};
+
+#endif

+ 30 - 0
Module_01/ex03/includes/Weapon.class.hpp

@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Weapon.class.hpp                                   :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 15:34:27 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 17:10:48 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef WEAPON_CLASS_H
+#define WEAPON_CLASS_H
+
+#include <iostream>
+
+class	Weapon {
+	public:
+		Weapon(std::string type);
+		~Weapon(void);
+
+		std::string	getType(void) const;
+		void		setType(std::string type);
+	
+	private:
+		std::string	_type;
+};
+
+#endif

+ 27 - 0
Module_01/ex03/srcs/HumanA.class.cpp

@@ -0,0 +1,27 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   HumanA.class.cpp                                   :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 15:54:21 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 18:13:42 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "HumanA.class.hpp"
+#include "Weapon.class.hpp"
+#include <iostream>
+
+HumanA::HumanA(std::string name, Weapon &weapon) : _name(name), _weapon(weapon) {
+	return ;
+}
+
+HumanA::~HumanA(void) {
+	return ;
+}
+
+void	HumanA::attack(void) const {
+	std::cout << this->_name << " attacks with their " << this->_weapon.getType() << std::endl;
+}

+ 32 - 0
Module_01/ex03/srcs/HumanB.class.cpp

@@ -0,0 +1,32 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   HumanB.class.cpp                                   :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 15:54:21 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 18:12:20 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "HumanB.class.hpp"
+#include <iostream>
+
+HumanB::HumanB(std::string name) : _name(name) {
+	return ;
+}
+
+
+HumanB::~HumanB(void) {
+	return ;
+}
+
+void	HumanB::attack(void) const {
+	std::cout << this->_name << " attacks with their " << this->_weapon->getType() << std::endl;
+}
+
+void	HumanB::setWeapon(Weapon &weapon) {
+	this->_weapon = &weapon;
+	return;
+}

+ 30 - 0
Module_01/ex03/srcs/Weapon.class.cpp

@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   Weapon.class.cpp                                   :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 15:48:04 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 16:46:07 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "Weapon.class.hpp"
+
+Weapon::Weapon(std::string type) : _type(type) {
+	return;
+}
+
+Weapon::~Weapon(void) {
+	return ;
+}
+
+std::string	Weapon::getType(void) const {
+	return this->_type;
+}
+
+void		Weapon::setType(std::string type) {
+	this->_type = type;
+	return ;
+}

+ 35 - 0
Module_01/ex03/srcs/main.cpp

@@ -0,0 +1,35 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 16:42:34 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 16:43:49 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "HumanA.class.hpp"
+#include "HumanB.class.hpp"
+#include "Weapon.class.hpp"
+
+int main()
+{
+	{
+		Weapon club = Weapon("crude spiked club");
+		HumanA bob("Bob", club);
+		bob.attack();
+		club.setType("some other type of club");
+		bob.attack();
+	}
+	{
+		Weapon club = Weapon("crude spiked club");
+		HumanB jim("Jim");
+		jim.setWeapon(club);
+		jim.attack();
+		club.setType("some other type of club");
+		jim.attack();
+	}
+	return 0;
+}

BIN
Module_01/ex03/weapon.tar.gz


BIN
Module_01/ex04/.objects/main.o


+ 50 - 0
Module_01/ex04/Makefile

@@ -0,0 +1,50 @@
+#******************************************************************************#
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#*   Updated: 2025/07/15 18:41:52 by bchanot          ###   ########.fr       *#
+#                                                                              #
+#******************************************************************************#
+
+NAME = ex00
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main
+SRCS = $(FILES)
+OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRCS)))
+RED = \033[1;31m
+BLUE = \033[1;34m
+CYAN = \033[0;36m
+GREEN = \033[1;32m
+YELLOW = \033[1;33m
+EOC = \033[0m
+
+all: $(NAME)
+
+$(NAME): $(OBJS)
+	@echo -e "$(GREEN)Objects created.$(EOC)"
+	@$(CC) $(OBJS) $(INC) -o $(NAME)
+	@echo -e "$(GREEN)Compilation complete.$(EOC)"
+
+$(OBJS_DIR)%.o: $(SRCS_DIR)%.cpp
+	@mkdir -p $(dir $@)
+	$(CC) -c $< $(INC) -o $@
+
+clean:
+	@echo -e "$(RED)Deleting objects.$(EOC)"
+	@/bin/rm -rf $(OBJS_DIR)
+
+fclean: clean
+	@echo -e "$(RED)Deleting binary.$(EOC)"
+	@/bin/rm -rf $(NAME)
+
+re: fclean all
+
+.PHONY: all clean fclean re

BIN
Module_01/ex04/ex00


+ 34 - 0
Module_01/ex04/srcs/main.cpp

@@ -0,0 +1,34 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 18:21:32 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 19:35:30 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include <iostream>
+#include <fstream>
+#include <regex>
+
+int main(int ac, char **av) {
+	
+	std::string	line;
+
+	if (ac < 3)
+		return 1;
+
+	std::ifstream	ifs(av[1]);
+	std::string		out_name = av[1];
+	std::ofstream	ofs(out_name.append(".replace"));
+
+	while (std::getline(ifs, line)) {
+		ofs << std::regex_replace(line, std::regex(av[2]), av[3]) << std::endl;
+	}
+	ifs.close();
+	ofs.close();
+	return 0;
+}

+ 34 - 0
Module_01/ex04/srcs/main.cpp.replace

@@ -0,0 +1,34 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 18:21:32 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/15 19:35:30 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#wafuuu <iostream>
+#wafuuu <fstream>
+#wafuuu <regex>
+
+int main(int ac, char **av) {
+	
+	std::string	line;
+
+	if (ac < 3)
+		return 1;
+
+	std::ifstream	ifs(av[1]);
+	std::string		out_name = av[1];
+	std::ofstream	ofs(out_name.append(".replace"));
+
+	while (std::getline(ifs, line)) {
+		ofs << std::regex_replace(line, std::regex(av[2]), av[3]) << std::endl;
+	}
+	ifs.close();
+	ofs.close();
+	return 0;
+}

BIN
Module_01/ex05/.objects/harl.class.o


BIN
Module_01/ex05/.objects/main.o


+ 50 - 0
Module_01/ex05/Makefile

@@ -0,0 +1,50 @@
+#******************************************************************************#
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#*   Updated: 2025/07/16 11:48:29 by bchanot          ###   ########.fr       *#
+#                                                                              #
+#******************************************************************************#
+
+NAME = ex00
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main harl.class
+SRCS = $(FILES)
+OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRCS)))
+RED = \033[1;31m
+BLUE = \033[1;34m
+CYAN = \033[0;36m
+GREEN = \033[1;32m
+YELLOW = \033[1;33m
+EOC = \033[0m
+
+all: $(NAME)
+
+$(NAME): $(OBJS)
+	@echo -e "$(GREEN)Objects created.$(EOC)"
+	@$(CC) $(OBJS) $(INC) -o $(NAME)
+	@echo -e "$(GREEN)Compilation complete.$(EOC)"
+
+$(OBJS_DIR)%.o: $(SRCS_DIR)%.cpp
+	@mkdir -p $(dir $@)
+	$(CC) -c $< $(INC) -o $@
+
+clean:
+	@echo -e "$(RED)Deleting objects.$(EOC)"
+	@/bin/rm -rf $(OBJS_DIR)
+
+fclean: clean
+	@echo -e "$(RED)Deleting binary.$(EOC)"
+	@/bin/rm -rf $(NAME)
+
+re: fclean all
+
+.PHONY: all clean fclean re

BIN
Module_01/ex05/ex00


+ 30 - 0
Module_01/ex05/includes/harl.class.hpp

@@ -0,0 +1,30 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   harl.class.hpp                                     :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 19:42:56 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 12:10:19 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+
+#ifndef HARL_CLASS_H
+# define HARL_CLASS_H
+
+#include <iostream>
+
+class	Harl {
+	private:
+		void	debug(void);
+		void	info(void);
+		void	warning(void);
+		void	error(void);
+
+	public:
+		void	complain(std::string level);
+};
+
+#endif

+ 45 - 0
Module_01/ex05/srcs/harl.class.cpp

@@ -0,0 +1,45 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   harl.class.cpp                                     :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 19:49:59 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 13:29:14 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "harl.class.hpp"
+
+void	Harl::debug(void) {
+	std::cout << "[DEBUG] I love having extra bacon for my 7XL-double-cheese-triple-pickle-special-ketchup burger. I really do!" << std::endl;
+}
+
+void	Harl::info(void) {
+	std::cout << "[INFO] I cannot believe adding extra bacon costs more money. You didn’t put enough bacon in my burger! If you did, I wouldn’t be asking for more!" << std::endl;
+}
+
+void	Harl::warning(void) {
+	std::cout << "[WARNING] I think I deserve to have some extra bacon for free. I’ve been coming for years, whereas you started working here just last month." << std::endl;
+}
+
+void	Harl::error(void) {
+	std::cout << "[ERROR] This is unacceptable! I want to speak to the manager now." << std::endl;
+}
+
+void	Harl::complain(std::string level) {
+	void		(Harl::*fn[])(void) = {&Harl::debug, &Harl::info, &Harl::warning, &Harl::error};
+	std::string	complain[] = {"DEBUG", "INFO", "WARNING", "ERROR"};
+	int			i;
+	bool		print = false;
+
+	i = 0;
+	while (i < 4) {
+		if (complain[i].compare(level) == 0 || print) {
+			print = true;
+			(this->*fn[i])();
+		}
+		i++;
+	}
+}

+ 20 - 0
Module_01/ex05/srcs/main.cpp

@@ -0,0 +1,20 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/16 11:45:53 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 11:48:15 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "harl.class.hpp"
+
+int main(void) {
+	Harl	harl;
+
+	harl.complain("WARNING");
+	return 0;
+}

BIN
Module_01/ex06/.objects/harl.class.o


BIN
Module_01/ex06/.objects/main.o


+ 50 - 0
Module_01/ex06/Makefile

@@ -0,0 +1,50 @@
+#******************************************************************************#
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@students.42.fr>           +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#*   Updated: 2025/07/16 11:48:29 by bchanot          ###   ########.fr       *#
+#                                                                              #
+#******************************************************************************#
+
+NAME = ex00
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main harl.class
+SRCS = $(FILES)
+OBJS = $(addprefix $(OBJS_DIR), $(addsuffix .o, $(SRCS)))
+RED = \033[1;31m
+BLUE = \033[1;34m
+CYAN = \033[0;36m
+GREEN = \033[1;32m
+YELLOW = \033[1;33m
+EOC = \033[0m
+
+all: $(NAME)
+
+$(NAME): $(OBJS)
+	@echo -e "$(GREEN)Objects created.$(EOC)"
+	@$(CC) $(OBJS) $(INC) -o $(NAME)
+	@echo -e "$(GREEN)Compilation complete.$(EOC)"
+
+$(OBJS_DIR)%.o: $(SRCS_DIR)%.cpp
+	@mkdir -p $(dir $@)
+	$(CC) -c $< $(INC) -o $@
+
+clean:
+	@echo -e "$(RED)Deleting objects.$(EOC)"
+	@/bin/rm -rf $(OBJS_DIR)
+
+fclean: clean
+	@echo -e "$(RED)Deleting binary.$(EOC)"
+	@/bin/rm -rf $(NAME)
+
+re: fclean all
+
+.PHONY: all clean fclean re

BIN
Module_01/ex06/ex00


+ 32 - 0
Module_01/ex06/includes/harl.class.hpp

@@ -0,0 +1,32 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   harl.class.hpp                                     :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 19:42:56 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 13:16:06 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+
+#ifndef HARL_CLASS_H
+# define HARL_CLASS_H
+
+#include <iostream>
+#include <array>
+
+class	Harl {
+	private:
+		void	debug(void);
+		void	info(void);
+		void	warning(void);
+		void	error(void);
+
+	public:
+		void	complain(std::string level);
+		static std::array<std::string, 4>	getLevels(void);
+};
+
+#endif

+ 50 - 0
Module_01/ex06/srcs/harl.class.cpp

@@ -0,0 +1,50 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   harl.class.cpp                                     :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/15 19:49:59 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 13:18:36 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "harl.class.hpp"
+
+void	Harl::debug(void) {
+	std::cout << "[DEBUG] I love having extra bacon for my 7XL-double-cheese-triple-pickle-special-ketchup burger. I really do!" << std::endl;
+}
+
+void	Harl::info(void) {
+	std::cout << "[INFO] I cannot believe adding extra bacon costs more money. You didn’t put enough bacon in my burger! If you did, I wouldn’t be asking for more!" << std::endl;
+}
+
+void	Harl::warning(void) {
+	std::cout << "[WARNING] I think I deserve to have some extra bacon for free. I’ve been coming for years, whereas you started working here just last month." << std::endl;
+}
+
+void	Harl::error(void) {
+	std::cout << "[ERROR] This is unacceptable! I want to speak to the manager now." << std::endl;
+}
+
+
+std::array<std::string, 4>	Harl::getLevels(void) {
+	return {"DEBUG", "INFO", "WARNING", "ERROR"};
+}
+
+void	Harl::complain(std::string level) {
+	void		(Harl::*fn[])(void) = {&Harl::debug, &Harl::info, &Harl::warning, &Harl::error};
+	std::array<std::string, 4> complain = Harl::getLevels();
+	int			i;
+	bool		print = false;
+
+	i = 0;
+	while (i < 4) {
+		if (complain[i].compare(level) == 0 || print) {
+			print = true;
+			(this->*fn[i])();
+		}
+		i++;
+	}
+}

+ 28 - 0
Module_01/ex06/srcs/main.cpp

@@ -0,0 +1,28 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@gmail.fr>                 +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/16 11:45:53 by bchanot           #+#    #+#             */
+/*   Updated: 2025/07/16 13:15:46 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "harl.class.hpp"
+
+int main(int ac, char **av) {
+	std::array<std::string, 4> levels = Harl::getLevels();
+	Harl	harl;
+
+	if (ac > 1) {
+		for (int i = 0; i < 4; i++)
+			if (levels[i].compare(av[1])) {
+				harl.complain(av[1]);
+				return 0;
+			}
+	}
+	std::cout << "[ Probably complaining about insignificant problems ]" << std::endl;
+	return 0;
+}