Kaynağa Gözat

added module03

bastien 1 ay önce
ebeveyn
işleme
b1ccfcbc45

+ 50 - 0
Module_03/ex01/Makefile

@@ -0,0 +1,50 @@
+# **************************************************************************** #
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#    Updated: 2025/12/18 14:46:39 by bchanot          ###   ########.fr        #
+#                                                                              #
+# **************************************************************************** #
+
+NAME = a.out
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main ClapTrap ScavTrap
+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

+ 44 - 0
Module_03/ex01/includes/ClapTrap.hpp

@@ -0,0 +1,44 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ClapTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 13:30:30 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:49:22 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef CLAPTRAP_HPP
+# define CLAPTRAP_HPP
+
+# include <iostream>
+# include <string>
+
+class ClapTrap
+{
+
+	public:
+
+		ClapTrap();
+		ClapTrap( std::string const & name );
+		ClapTrap( ClapTrap const & src );
+		~ClapTrap();
+
+		ClapTrap &		operator=( ClapTrap const & rhs );
+
+		void			attack(const std::string & target);
+		void			takeDamage(unsigned int amount);
+		void			beRepaired(unsigned int amount);
+
+	protected:
+		std::string		const	_name;
+		u_int16_t				_hitPoints;
+		u_int16_t				_energyPoints;
+		u_int16_t				_attackDamage;
+};
+
+std::ostream &			operator<<( std::ostream & o, ClapTrap const & i );
+
+#endif /* ******************************************************** CLAPTRAP_H */

+ 40 - 0
Module_03/ex01/includes/ScavTrap.hpp

@@ -0,0 +1,40 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ScavTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:28:06 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:48:19 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef SCAVTRAP_HPP
+# define SCAVTRAP_HPP
+
+# include <iostream>
+# include <string>
+#include "ClapTrap.hpp"
+
+class ScavTrap : public ClapTrap
+{
+
+	public:
+
+		ScavTrap();
+		ScavTrap( std::string const & name );
+		ScavTrap( ScavTrap const & src );
+		~ScavTrap();
+
+		ScavTrap &		operator=( ScavTrap const & rhs );
+
+		void			guardGate(void) const;
+
+	private:
+
+};
+
+std::ostream &			operator<<( std::ostream & o, ScavTrap const & i );
+
+#endif /* ******************************************************** SCAVTRAP_H */

+ 116 - 0
Module_03/ex01/srcs/ClapTrap.cpp

@@ -0,0 +1,116 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ClapTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 13:30:29 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:49:15 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "ClapTrap.hpp"
+#include <limits>
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+ClapTrap::ClapTrap() : _name("Default"), _hitPoints(10), _energyPoints(10), _attackDamage(0)
+{
+	std::cout << "ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+ClapTrap::ClapTrap( std::string const & name) : _name(name), _hitPoints(10), _energyPoints(10), _attackDamage(0)
+{
+	std::cout << "ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+ClapTrap::ClapTrap( ClapTrap const & src ) : _name(src._name), _hitPoints(src._hitPoints), _energyPoints(src._energyPoints), _attackDamage(src._attackDamage)
+{
+	std::cout << "Copy of ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+ClapTrap::~ClapTrap()
+{
+	std::cout << "ClapTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+ClapTrap &				ClapTrap::operator=( ClapTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, ClapTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void					ClapTrap::attack(const std::string& target) {
+	if (this->_hitPoints > 0) {
+		if (this->_energyPoints > 0) {
+			this->_energyPoints--;
+			std::cout << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_attackDamage << " points of damage !" << std::endl;
+		} else
+			std::cout << "ClapTrap " << this->_name << " Doesn't have enough energy to attack !" << std::endl;
+	} else 
+		std::cout << "ClapTrap " << this->_name << " is dead.. How could he attack ?" << std::endl;
+}
+
+void					ClapTrap::takeDamage(unsigned int amount) {
+	if (this->_hitPoints > 0) {
+		if (this->_hitPoints < amount) {
+			this->_hitPoints = 0;
+			std::cout << this->_name << " is taking " << amount << " damage.. Causing his death ! he is now 0 HP..." << std::endl;
+		} else {
+			this->_hitPoints -= amount;
+			std::cout << this->_name << " is taking " << amount << " damage. He got now " << this->_hitPoints << " HP" << std::endl;
+		}
+	} else
+		std::cout << this->_name << " is 0 HP, already dead. Cannot attack a dead ClapTrap. Do we .. ?" << std::endl;
+}
+
+void					ClapTrap::beRepaired(unsigned int amount) {
+	if (this->_hitPoints > 0) {
+		if (this->_energyPoints > 0) {
+			if (this->_hitPoints + amount > std::numeric_limits<short unsigned int>::max()) 
+				this->_hitPoints = std::numeric_limits<short unsigned int>::max();
+			else
+				this->_hitPoints += amount;
+			this->_energyPoints--;
+			std::cout << this->_name << " is getting repaired about " << amount << " HP. Getting now " << this->_hitPoints << " HP." << std::endl;
+		} else
+			std::cout << "ClapTrap " << this->_name << " Doesn't have enought energy..." << std::endl;
+	} else
+		std::cout << this->_name << " is 0 HP, it mean DEAD. so, he cannot do anything more..." << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 89 - 0
Module_03/ex01/srcs/ScavTrap.cpp

@@ -0,0 +1,89 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ScavTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:28:06 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:50:00 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "ScavTrap.hpp"
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+ScavTrap::ScavTrap() : ClapTrap()
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+ScavTrap::ScavTrap( std::string const & name ) : ClapTrap(name)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+ScavTrap::ScavTrap( ScavTrap const & src ) : ClapTrap(src)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "Copy of ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+ScavTrap::~ScavTrap()
+{
+	std::cout << "ScavTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+ScavTrap &				ScavTrap::operator=( ScavTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, ScavTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void				ScavTrap::guardGate(void) const {
+	std::cout << "ScavTrap " << this->_name << " Is holding the door !" << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 40 - 0
Module_03/ex01/srcs/main.cpp

@@ -0,0 +1,40 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/17 15:10:40 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:46:21 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "ScavTrap.hpp"
+
+#include <iostream>
+#include <limits>
+
+int main( void ) {
+			ScavTrap    scav("Scav");
+		ScavTrap    trap("Trap");
+
+		scav.attack("Trap");
+		trap.beRepaired(2);
+		trap.takeDamage(112);
+
+		// Can't attack because he is dead
+		trap.attack("Scav");
+		scav.beRepaired(std::numeric_limits<short unsigned int>::max());
+		scav.takeDamage(100);
+		scav.takeDamage(std::numeric_limits<short unsigned int>::max());
+		scav = ScavTrap("Scav");
+		for (int i = 0; i < 52; i++)
+			scav.attack("Bidule");
+		trap = ScavTrap(scav);
+		trap.takeDamage(100);
+		scav = trap;
+		trap.takeDamage(100);
+		scav.guardGate();
+	return (0);
+}

+ 50 - 0
Module_03/ex02/Makefile

@@ -0,0 +1,50 @@
+# **************************************************************************** #
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#    Updated: 2025/12/18 14:56:26 by bchanot          ###   ########.fr        #
+#                                                                              #
+# **************************************************************************** #
+
+NAME = a.out
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main ClapTrap ScavTrap FragTrap
+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

+ 44 - 0
Module_03/ex02/includes/ClapTrap.hpp

@@ -0,0 +1,44 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ClapTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 13:30:30 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:49:22 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef CLAPTRAP_HPP
+# define CLAPTRAP_HPP
+
+# include <iostream>
+# include <string>
+
+class ClapTrap
+{
+
+	public:
+
+		ClapTrap();
+		ClapTrap( std::string const & name );
+		ClapTrap( ClapTrap const & src );
+		~ClapTrap();
+
+		ClapTrap &		operator=( ClapTrap const & rhs );
+
+		void			attack(const std::string & target);
+		void			takeDamage(unsigned int amount);
+		void			beRepaired(unsigned int amount);
+
+	protected:
+		std::string		const	_name;
+		u_int16_t				_hitPoints;
+		u_int16_t				_energyPoints;
+		u_int16_t				_attackDamage;
+};
+
+std::ostream &			operator<<( std::ostream & o, ClapTrap const & i );
+
+#endif /* ******************************************************** CLAPTRAP_H */

+ 40 - 0
Module_03/ex02/includes/FragTrap.hpp

@@ -0,0 +1,40 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   FragTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:51:41 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:55:02 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef FRAGTRAP_HPP
+# define FRAGTRAP_HPP
+
+# include <iostream>
+# include <string>
+#include "ClapTrap.hpp"
+
+class FragTrap : public ClapTrap
+{
+
+	public:
+
+		FragTrap();
+		FragTrap( std::string const & name );
+		FragTrap( FragTrap const & src );
+		~FragTrap();
+
+		FragTrap &		operator=( FragTrap const & rhs );
+
+		void			highFiveGuys(void) const;
+
+	private:
+
+};
+
+std::ostream &			operator<<( std::ostream & o, FragTrap const & i );
+
+#endif /* ******************************************************** FRAGTRAP_H */

+ 40 - 0
Module_03/ex02/includes/ScavTrap.hpp

@@ -0,0 +1,40 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ScavTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:28:06 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:48:19 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef SCAVTRAP_HPP
+# define SCAVTRAP_HPP
+
+# include <iostream>
+# include <string>
+#include "ClapTrap.hpp"
+
+class ScavTrap : public ClapTrap
+{
+
+	public:
+
+		ScavTrap();
+		ScavTrap( std::string const & name );
+		ScavTrap( ScavTrap const & src );
+		~ScavTrap();
+
+		ScavTrap &		operator=( ScavTrap const & rhs );
+
+		void			guardGate(void) const;
+
+	private:
+
+};
+
+std::ostream &			operator<<( std::ostream & o, ScavTrap const & i );
+
+#endif /* ******************************************************** SCAVTRAP_H */

+ 116 - 0
Module_03/ex02/srcs/ClapTrap.cpp

@@ -0,0 +1,116 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ClapTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 13:30:29 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:49:15 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "ClapTrap.hpp"
+#include <limits>
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+ClapTrap::ClapTrap() : _name("Default"), _hitPoints(10), _energyPoints(10), _attackDamage(0)
+{
+	std::cout << "ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+ClapTrap::ClapTrap( std::string const & name) : _name(name), _hitPoints(10), _energyPoints(10), _attackDamage(0)
+{
+	std::cout << "ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+ClapTrap::ClapTrap( ClapTrap const & src ) : _name(src._name), _hitPoints(src._hitPoints), _energyPoints(src._energyPoints), _attackDamage(src._attackDamage)
+{
+	std::cout << "Copy of ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+ClapTrap::~ClapTrap()
+{
+	std::cout << "ClapTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+ClapTrap &				ClapTrap::operator=( ClapTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, ClapTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void					ClapTrap::attack(const std::string& target) {
+	if (this->_hitPoints > 0) {
+		if (this->_energyPoints > 0) {
+			this->_energyPoints--;
+			std::cout << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_attackDamage << " points of damage !" << std::endl;
+		} else
+			std::cout << "ClapTrap " << this->_name << " Doesn't have enough energy to attack !" << std::endl;
+	} else 
+		std::cout << "ClapTrap " << this->_name << " is dead.. How could he attack ?" << std::endl;
+}
+
+void					ClapTrap::takeDamage(unsigned int amount) {
+	if (this->_hitPoints > 0) {
+		if (this->_hitPoints < amount) {
+			this->_hitPoints = 0;
+			std::cout << this->_name << " is taking " << amount << " damage.. Causing his death ! he is now 0 HP..." << std::endl;
+		} else {
+			this->_hitPoints -= amount;
+			std::cout << this->_name << " is taking " << amount << " damage. He got now " << this->_hitPoints << " HP" << std::endl;
+		}
+	} else
+		std::cout << this->_name << " is 0 HP, already dead. Cannot attack a dead ClapTrap. Do we .. ?" << std::endl;
+}
+
+void					ClapTrap::beRepaired(unsigned int amount) {
+	if (this->_hitPoints > 0) {
+		if (this->_energyPoints > 0) {
+			if (this->_hitPoints + amount > std::numeric_limits<short unsigned int>::max()) 
+				this->_hitPoints = std::numeric_limits<short unsigned int>::max();
+			else
+				this->_hitPoints += amount;
+			this->_energyPoints--;
+			std::cout << this->_name << " is getting repaired about " << amount << " HP. Getting now " << this->_hitPoints << " HP." << std::endl;
+		} else
+			std::cout << "ClapTrap " << this->_name << " Doesn't have enought energy..." << std::endl;
+	} else
+		std::cout << this->_name << " is 0 HP, it mean DEAD. so, he cannot do anything more..." << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 89 - 0
Module_03/ex02/srcs/FragTrap.cpp

@@ -0,0 +1,89 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   FragTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:51:41 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:54:45 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "FragTrap.hpp"
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+FragTrap::FragTrap() : ClapTrap()
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 100;
+	this->_attackDamage = 30;
+	std::cout << "FragTrap " << this->_name << " has been created" << std::endl;
+}
+
+FragTrap::FragTrap( std::string const & name ) : ClapTrap(name)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 100;
+	this->_attackDamage = 30;
+	std::cout << "FragTrap " << this->_name << " has been created" << std::endl;
+}
+
+FragTrap::FragTrap( FragTrap const & src ) : ClapTrap(src)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 100;
+	this->_attackDamage = 30;
+	std::cout << "Copy of FragTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+FragTrap::~FragTrap()
+{
+	std::cout << "FragTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+FragTrap &				FragTrap::operator=( FragTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, FragTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void				FragTrap::highFiveGuys(void) const {
+	std::cout << "FragTrap " << this->_name << " Is initiating a High Five with friends !" << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 89 - 0
Module_03/ex02/srcs/ScavTrap.cpp

@@ -0,0 +1,89 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ScavTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:28:06 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:50:00 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "ScavTrap.hpp"
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+ScavTrap::ScavTrap() : ClapTrap()
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+ScavTrap::ScavTrap( std::string const & name ) : ClapTrap(name)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+ScavTrap::ScavTrap( ScavTrap const & src ) : ClapTrap(src)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "Copy of ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+ScavTrap::~ScavTrap()
+{
+	std::cout << "ScavTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+ScavTrap &				ScavTrap::operator=( ScavTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, ScavTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void				ScavTrap::guardGate(void) const {
+	std::cout << "ScavTrap " << this->_name << " Is holding the door !" << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 40 - 0
Module_03/ex02/srcs/main.cpp

@@ -0,0 +1,40 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/17 15:10:40 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:56:04 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "FragTrap.hpp"
+
+#include <iostream>
+#include <limits>
+
+int main( void ) {
+			FragTrap	Frag("Frag");
+		FragTrap    trap("Trap");
+
+		Frag.attack("Trap");
+		trap.beRepaired(2);
+		trap.takeDamage(112);
+
+		// Can't attack because he is dead
+		trap.attack("Frag");
+		Frag.beRepaired(std::numeric_limits<short unsigned int>::max());
+		Frag.takeDamage(100);
+		Frag.takeDamage(std::numeric_limits<short unsigned int>::max());
+		Frag = FragTrap("Frag");
+		for (int i = 0; i < 52; i++)
+			Frag.attack("Bidule");
+		trap = FragTrap(Frag);
+		trap.takeDamage(100);
+		Frag = trap;
+		trap.takeDamage(100);
+
+	return (0);
+}

+ 50 - 0
Module_03/ex03/Makefile

@@ -0,0 +1,50 @@
+# **************************************************************************** #
+#                                                                              #
+#                                                         :::      ::::::::    #
+#    Makefile                                           :+:      :+:    :+:    #
+#                                                     +:+ +:+         +:+      #
+#    By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+         #
+#                                                 +#+#+#+#+#+   +#+            #
+#    Created: 2016/07/24 00:00:08 by bchanot           #+#    #+#              #
+#    Updated: 2025/12/18 15:08:40 by bchanot          ###   ########.fr        #
+#                                                                              #
+# **************************************************************************** #
+
+NAME = a.out
+MAKE_LIBS = make --no-print-directory
+SRCS_DIR = srcs/
+OBJS_DIR = .objects/
+CC = g++ -Wall -Wextra -Werror -g
+INC = -I./includes
+FILES = main ClapTrap ScavTrap FragTrap DiamondTrap
+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

+ 44 - 0
Module_03/ex03/includes/ClapTrap.hpp

@@ -0,0 +1,44 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ClapTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 13:30:30 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 15:13:51 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef CLAPTRAP_HPP
+# define CLAPTRAP_HPP
+
+# include <iostream>
+# include <string>
+
+class ClapTrap
+{
+
+	public:
+
+		ClapTrap();
+		ClapTrap( std::string const & name );
+		ClapTrap( ClapTrap const & src );
+		~ClapTrap();
+
+		ClapTrap &		operator=( ClapTrap const & rhs );
+
+		void			attack(const std::string & target);
+		void			takeDamage(unsigned int amount);
+		void			beRepaired(unsigned int amount);
+
+	protected:
+		std::string				_name;
+		u_int16_t				_hitPoints;
+		u_int16_t				_energyPoints;
+		u_int16_t				_attackDamage;
+};
+
+std::ostream &			operator<<( std::ostream & o, ClapTrap const & i );
+
+#endif /* ******************************************************** CLAPTRAP_H */

+ 46 - 0
Module_03/ex03/includes/DiamondTrap.hpp

@@ -0,0 +1,46 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   DiamondTrap.hpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:57:48 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 15:14:00 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef DIAMONDTRAP_HPP
+# define DIAMONDTRAP_HPP
+
+# include <iostream>
+# include <string>
+
+#include "ClapTrap.hpp"
+#include "ScavTrap.hpp"
+#include "FragTrap.hpp"
+
+class DiamondTrap : public ScavTrap, public FragTrap
+{
+
+	public:
+
+		DiamondTrap();
+		DiamondTrap( std::string const & name );
+		DiamondTrap( DiamondTrap const & src );
+		~DiamondTrap();
+
+		DiamondTrap &		operator=( DiamondTrap const & rhs );
+
+		void				whoAmI(void) const;
+
+		using ScavTrap::attack;
+
+	private:
+		std::string			_name;
+
+};
+
+std::ostream &			operator<<( std::ostream & o, DiamondTrap const & i );
+
+#endif /* ***************************************************** DIAMONDTRAP_H */

+ 40 - 0
Module_03/ex03/includes/FragTrap.hpp

@@ -0,0 +1,40 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   FragTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:51:41 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 15:05:41 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef FRAGTRAP_HPP
+# define FRAGTRAP_HPP
+
+# include <iostream>
+# include <string>
+#include "ClapTrap.hpp"
+
+class FragTrap : virtual public ClapTrap
+{
+
+	public:
+
+		FragTrap();
+		FragTrap( std::string const & name );
+		FragTrap( FragTrap const & src );
+		~FragTrap();
+
+		FragTrap &		operator=( FragTrap const & rhs );
+
+		void			highFiveGuys(void) const;
+
+	private:
+
+};
+
+std::ostream &			operator<<( std::ostream & o, FragTrap const & i );
+
+#endif /* ******************************************************** FRAGTRAP_H */

+ 40 - 0
Module_03/ex03/includes/ScavTrap.hpp

@@ -0,0 +1,40 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ScavTrap.hpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:28:06 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 15:05:47 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#ifndef SCAVTRAP_HPP
+# define SCAVTRAP_HPP
+
+# include <iostream>
+# include <string>
+#include "ClapTrap.hpp"
+
+class ScavTrap : virtual public ClapTrap
+{
+
+	public:
+
+		ScavTrap();
+		ScavTrap( std::string const & name );
+		ScavTrap( ScavTrap const & src );
+		~ScavTrap();
+
+		ScavTrap &		operator=( ScavTrap const & rhs );
+
+		void			guardGate(void) const;
+
+	private:
+
+};
+
+std::ostream &			operator<<( std::ostream & o, ScavTrap const & i );
+
+#endif /* ******************************************************** SCAVTRAP_H */

+ 116 - 0
Module_03/ex03/srcs/ClapTrap.cpp

@@ -0,0 +1,116 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ClapTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 13:30:29 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:49:15 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "ClapTrap.hpp"
+#include <limits>
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+ClapTrap::ClapTrap() : _name("Default"), _hitPoints(10), _energyPoints(10), _attackDamage(0)
+{
+	std::cout << "ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+ClapTrap::ClapTrap( std::string const & name) : _name(name), _hitPoints(10), _energyPoints(10), _attackDamage(0)
+{
+	std::cout << "ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+ClapTrap::ClapTrap( ClapTrap const & src ) : _name(src._name), _hitPoints(src._hitPoints), _energyPoints(src._energyPoints), _attackDamage(src._attackDamage)
+{
+	std::cout << "Copy of ClapTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+ClapTrap::~ClapTrap()
+{
+	std::cout << "ClapTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+ClapTrap &				ClapTrap::operator=( ClapTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, ClapTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void					ClapTrap::attack(const std::string& target) {
+	if (this->_hitPoints > 0) {
+		if (this->_energyPoints > 0) {
+			this->_energyPoints--;
+			std::cout << "ClapTrap " << this->_name << " attacks " << target << ", causing " << this->_attackDamage << " points of damage !" << std::endl;
+		} else
+			std::cout << "ClapTrap " << this->_name << " Doesn't have enough energy to attack !" << std::endl;
+	} else 
+		std::cout << "ClapTrap " << this->_name << " is dead.. How could he attack ?" << std::endl;
+}
+
+void					ClapTrap::takeDamage(unsigned int amount) {
+	if (this->_hitPoints > 0) {
+		if (this->_hitPoints < amount) {
+			this->_hitPoints = 0;
+			std::cout << this->_name << " is taking " << amount << " damage.. Causing his death ! he is now 0 HP..." << std::endl;
+		} else {
+			this->_hitPoints -= amount;
+			std::cout << this->_name << " is taking " << amount << " damage. He got now " << this->_hitPoints << " HP" << std::endl;
+		}
+	} else
+		std::cout << this->_name << " is 0 HP, already dead. Cannot attack a dead ClapTrap. Do we .. ?" << std::endl;
+}
+
+void					ClapTrap::beRepaired(unsigned int amount) {
+	if (this->_hitPoints > 0) {
+		if (this->_energyPoints > 0) {
+			if (this->_hitPoints + amount > std::numeric_limits<short unsigned int>::max()) 
+				this->_hitPoints = std::numeric_limits<short unsigned int>::max();
+			else
+				this->_hitPoints += amount;
+			this->_energyPoints--;
+			std::cout << this->_name << " is getting repaired about " << amount << " HP. Getting now " << this->_hitPoints << " HP." << std::endl;
+		} else
+			std::cout << "ClapTrap " << this->_name << " Doesn't have enought energy..." << std::endl;
+	} else
+		std::cout << this->_name << " is 0 HP, it mean DEAD. so, he cannot do anything more..." << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 88 - 0
Module_03/ex03/srcs/DiamondTrap.cpp

@@ -0,0 +1,88 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   DiamondTrap.cpp                                    :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:57:48 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 15:40:14 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "DiamondTrap.hpp"
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+DiamondTrap::DiamondTrap() : ClapTrap("Default_clap_name"), ScavTrap(), FragTrap(), _name("Default")
+{
+	this->_hitPoints = FragTrap::_hitPoints;
+	this->_energyPoints = ScavTrap::_energyPoints;
+	this->_attackDamage = FragTrap::_attackDamage;
+	std::cout << "DiamondTrap " << this->_name << " has been created" << std::endl;
+}
+
+DiamondTrap::DiamondTrap( std::string const & name ) : ClapTrap(name + "_clap_name"), ScavTrap(name), FragTrap(name), _name(name)
+{
+	this->_hitPoints = FragTrap::_hitPoints;
+	this->_energyPoints = ScavTrap::_energyPoints;
+	this->_attackDamage = FragTrap::_attackDamage;
+	std::cout << "DiamondTrap " << this->_name << " has been created" << std::endl;
+}
+
+DiamondTrap::DiamondTrap( DiamondTrap const & src ) : ClapTrap(src), ScavTrap(src), FragTrap(src)
+{
+	std::cout << "Copy of DiamondTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+DiamondTrap::~DiamondTrap()
+{
+	std::cout << "DiamondTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+DiamondTrap &				DiamondTrap::operator=( DiamondTrap const & rhs )
+{
+	if (&rhs == this)
+		return *this;
+	this->ClapTrap::_name = rhs.ClapTrap::_name;
+	this->_name = rhs._name;
+	this->_hitPoints = rhs._hitPoints;
+	this->_energyPoints = rhs._energyPoints;
+	this->_attackDamage = rhs._attackDamage;
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, DiamondTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void				DiamondTrap::whoAmI(void) const {
+	std::cout << "DiamondTrap Say : Hello i am " << this->_name << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 89 - 0
Module_03/ex03/srcs/FragTrap.cpp

@@ -0,0 +1,89 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   FragTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:51:41 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:54:45 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "FragTrap.hpp"
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+FragTrap::FragTrap() : ClapTrap()
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 100;
+	this->_attackDamage = 30;
+	std::cout << "FragTrap " << this->_name << " has been created" << std::endl;
+}
+
+FragTrap::FragTrap( std::string const & name ) : ClapTrap(name)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 100;
+	this->_attackDamage = 30;
+	std::cout << "FragTrap " << this->_name << " has been created" << std::endl;
+}
+
+FragTrap::FragTrap( FragTrap const & src ) : ClapTrap(src)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 100;
+	this->_attackDamage = 30;
+	std::cout << "Copy of FragTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+FragTrap::~FragTrap()
+{
+	std::cout << "FragTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+FragTrap &				FragTrap::operator=( FragTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, FragTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void				FragTrap::highFiveGuys(void) const {
+	std::cout << "FragTrap " << this->_name << " Is initiating a High Five with friends !" << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 89 - 0
Module_03/ex03/srcs/ScavTrap.cpp

@@ -0,0 +1,89 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   ScavTrap.cpp                                       :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/12/18 14:28:06 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 14:50:00 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "ScavTrap.hpp"
+
+/*
+** ------------------------------- CONSTRUCTOR --------------------------------
+*/
+
+ScavTrap::ScavTrap() : ClapTrap()
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+ScavTrap::ScavTrap( std::string const & name ) : ClapTrap(name)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+ScavTrap::ScavTrap( ScavTrap const & src ) : ClapTrap(src)
+{
+	this->_hitPoints = 100;
+	this->_energyPoints = 50;
+	this->_attackDamage = 20;
+	std::cout << "Copy of ScavTrap " << this->_name << " has been created" << std::endl;
+}
+
+
+/*
+** -------------------------------- DESTRUCTOR --------------------------------
+*/
+
+ScavTrap::~ScavTrap()
+{
+	std::cout << "ScavTrap " << this->_name << " has been destroyed !" << std::endl;
+}
+
+
+/*
+** --------------------------------- OVERLOAD ---------------------------------
+*/
+
+ScavTrap &				ScavTrap::operator=( ScavTrap const & rhs )
+{
+	(void)rhs;
+	//if ( this != &rhs )
+	//{
+		//this->_value = rhs.getValue();
+	//}
+	return *this;
+}
+
+std::ostream &			operator<<( std::ostream & o, ScavTrap const & i )
+{
+	(void)i;
+	//o << "Value = " << i.getValue();
+	return o;
+}
+
+
+/*
+** --------------------------------- METHODS ----------------------------------
+*/
+
+void				ScavTrap::guardGate(void) const {
+	std::cout << "ScavTrap " << this->_name << " Is holding the door !" << std::endl;
+}
+
+/*
+** --------------------------------- ACCESSOR ---------------------------------
+*/
+
+
+/* ************************************************************************** */

+ 25 - 0
Module_03/ex03/srcs/main.cpp

@@ -0,0 +1,25 @@
+/* ************************************************************************** */
+/*                                                                            */
+/*                                                        :::      ::::::::   */
+/*   main.cpp                                           :+:      :+:    :+:   */
+/*                                                    +:+ +:+         +:+     */
+/*   By: bchanot <bchanot@42.fr>                    +#+  +:+       +#+        */
+/*                                                +#+#+#+#+#+   +#+           */
+/*   Created: 2025/07/17 15:10:40 by bchanot           #+#    #+#             */
+/*   Updated: 2025/12/18 15:09:29 by bchanot          ###   ########.fr       */
+/*                                                                            */
+/* ************************************************************************** */
+
+#include "DiamondTrap.hpp"
+
+#include <iostream>
+#include <limits>
+
+int main( void ) {
+
+		DiamondTrap diamondTrap = DiamondTrap("Marvin");
+
+	diamondTrap.whoAmI();
+	diamondTrap.attack("Monster");
+	return (0);
+}