From 1cff8e9d9efd6872d6c8ff6722a8f9026a443653 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 6 Feb 2025 17:56:59 +0100 Subject: [PATCH] feat: starting the ex01 --- cpp04/ex01/Animal.cpp | 32 +++++++++++ cpp04/ex01/Animal.hpp | 30 +++++++++++ cpp04/ex01/Brain.cpp | 24 +++++++++ cpp04/ex01/Brain.hpp | 29 ++++++++++ cpp04/ex01/Cat.cpp | 26 +++++++++ cpp04/ex01/Cat.hpp | 29 ++++++++++ cpp04/ex01/Dog.cpp | 26 +++++++++ cpp04/ex01/Dog.hpp | 30 +++++++++++ cpp04/ex01/Makefile | 121 ++++++++++++++++++++++++++++++++++++++++++ cpp04/ex01/a.out | Bin 0 -> 18720 bytes cpp04/ex01/main.cpp | 27 ++++++++++ 11 files changed, 374 insertions(+) create mode 100644 cpp04/ex01/Animal.cpp create mode 100644 cpp04/ex01/Animal.hpp create mode 100644 cpp04/ex01/Brain.cpp create mode 100644 cpp04/ex01/Brain.hpp create mode 100644 cpp04/ex01/Cat.cpp create mode 100644 cpp04/ex01/Cat.hpp create mode 100644 cpp04/ex01/Dog.cpp create mode 100644 cpp04/ex01/Dog.hpp create mode 100644 cpp04/ex01/Makefile create mode 100755 cpp04/ex01/a.out create mode 100644 cpp04/ex01/main.cpp diff --git a/cpp04/ex01/Animal.cpp b/cpp04/ex01/Animal.cpp new file mode 100644 index 0000000..410e2e7 --- /dev/null +++ b/cpp04/ex01/Animal.cpp @@ -0,0 +1,32 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Animal.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/01/30 13:21:01 by rparodi #+# #+# */ +/* Updated: 2025/01/30 13:37:51 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Animal.hpp" +#include + +Animal::Animal() { + std::cout << "[Animal] Creating the class" << std::endl; + type = ""; +} + +Animal::~Animal() { + std::cout << "[Animal] Deleting the class" << std::endl; +} + +void Animal::makeSound() { + if (type.compare("Cat")) + std::cout << "🐱 | Meow Meow" << std::endl; + else if (type.compare("Dog")) + std::cout << "🐶 | Wouf Wouf" << std::endl; + else + std::cout << "🤔 | thinking how to make a sound" << std::endl; +} diff --git a/cpp04/ex01/Animal.hpp b/cpp04/ex01/Animal.hpp new file mode 100644 index 0000000..bcd273a --- /dev/null +++ b/cpp04/ex01/Animal.hpp @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Animal.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/01/28 17:44:54 by rparodi #+# #+# */ +/* Updated: 2025/01/30 13:42:23 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef ANIMAL_HPP +#define ANIMAL_HPP + +#include +#include + +class Animal { + public: + Animal(); + ~Animal(); + void makeSound(); + std::string getType(); + protected: + std::string type; + private: +}; + +#endif diff --git a/cpp04/ex01/Brain.cpp b/cpp04/ex01/Brain.cpp new file mode 100644 index 0000000..2c6db6f --- /dev/null +++ b/cpp04/ex01/Brain.cpp @@ -0,0 +1,24 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Brain.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/02/06 15:17:41 by rparodi #+# #+# */ +/* Updated: 2025/02/06 17:56:18 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Brain.hpp" +#include + +Brain::Brain() { + for (int i = 0; i < 100; i++) { + idea[i] = "I'm thinking about the number " + std::to_string(i + 1); + } +} + +Brain::~Brain() { + +} diff --git a/cpp04/ex01/Brain.hpp b/cpp04/ex01/Brain.hpp new file mode 100644 index 0000000..2d0237e --- /dev/null +++ b/cpp04/ex01/Brain.hpp @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Brain.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/02/06 15:17:49 by rparodi #+# #+# */ +/* Updated: 2025/02/06 17:35:51 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef BRAIN_HPP +#define BRAIN_HPP + +#include +class Brain { + public: + Brain(); + ~Brain(); + std::string idea[100]; + + protected: + + private: + +}; + +#endif diff --git a/cpp04/ex01/Cat.cpp b/cpp04/ex01/Cat.cpp new file mode 100644 index 0000000..207c674 --- /dev/null +++ b/cpp04/ex01/Cat.cpp @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Cat.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/01/30 13:32:43 by rparodi #+# #+# */ +/* Updated: 2025/01/30 13:38:46 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Cat.hpp" + +Cat::Cat() { + std::cout << "[Cat] Creating the class" << std::endl; + type = "Cat"; +} + +Cat::~Cat() { + std::cout << "[Cat] Deleting the class" << std::endl; +} + +std::string Cat::getType() { + return (type); +} diff --git a/cpp04/ex01/Cat.hpp b/cpp04/ex01/Cat.hpp new file mode 100644 index 0000000..130e8ed --- /dev/null +++ b/cpp04/ex01/Cat.hpp @@ -0,0 +1,29 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Cat.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/01/28 17:44:48 by rparodi #+# #+# */ +/* Updated: 2025/01/30 13:41:27 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef CAT_HPP +#define CAT_HPP + +#include "Animal.hpp" +#include + +class Cat : public Animal { + public: + Cat(); + ~Cat(); + protected: + + private: + +}; + +#endif diff --git a/cpp04/ex01/Dog.cpp b/cpp04/ex01/Dog.cpp new file mode 100644 index 0000000..cf6a045 --- /dev/null +++ b/cpp04/ex01/Dog.cpp @@ -0,0 +1,26 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Dog.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/01/30 13:40:30 by rparodi #+# #+# */ +/* Updated: 2025/01/30 13:40:51 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Dog.hpp" + +Dog::Dog() { + std::cout << "[Dog] Creating the class" << std::endl; + type = "Dog"; +} + +Dog::~Dog() { + std::cout << "[Dog] Deleting the class" << std::endl; +} + +std::string Dog::getType() { + return (type); +} diff --git a/cpp04/ex01/Dog.hpp b/cpp04/ex01/Dog.hpp new file mode 100644 index 0000000..80c5361 --- /dev/null +++ b/cpp04/ex01/Dog.hpp @@ -0,0 +1,30 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* Dog.hpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/01/28 17:44:51 by rparodi #+# #+# */ +/* Updated: 2025/01/30 13:32:28 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef DOG_HPP +#define DOG_HPP + +#include "Animal.hpp" +#include + +class Dog : public Animal { + public: + Dog(); + ~Dog(); + std::string getType(); + protected: + + private: + +}; + +#endif diff --git a/cpp04/ex01/Makefile b/cpp04/ex01/Makefile new file mode 100644 index 0000000..8380d2b --- /dev/null +++ b/cpp04/ex01/Makefile @@ -0,0 +1,121 @@ +# **************************************************************************** # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: rparodi +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2023/11/12 11:05:05 by rparodi #+# #+# # +# Updated: 2024/12/21 19:50:58 by rparodi ### ########.fr # +# # +# **************************************************************************** # + +# Variables + +# Name +NAME = polyformism + +# Commands +CXX = c++ +RM = rm -rf + +# Flags +# Mandatory flags for 42 CXXFLAGS = -Werror -Wextra -Wall -std=c++98 -I./includes/ +# Flags to debug and have the dependences (can be removed for correction) +CXXFLAGS += -MMD -g3 +# Flag to debug (TO REMOVE) +# CXXFLAGS += -D DEBUG=1 +# Sources +SRC = main.cpp + +# Objects +OBJDIRNAME = ./build +OBJ = $(addprefix $(OBJDIRNAME)/,$(SRC:.cpp=.o)) + +# Colors +GREEN = \033[32m +GREY = \033[0;90m +RED = \033[0;31m +GOLD = \033[38;5;220m +END = \033[0m + +# Rules + +# All (make all) +all: header $(NAME) footer + +# Bonus (make bonus) +bonus: header $(OBJ) footer + @mkdir -p $(OBJDIRNAME) + @printf '$(GREY) Creating $(END)$(GREEN)$(OBJDIRNAME)$(END)\n' + @$(CXX) $(CXXFLAGS) -o $(NAME) $(OBJ) + +# Clean (make clean) +clean: + @printf '$(GREY) Removing $(END)$(RED)Objects$(END)\n' + @printf '$(GREY) Removing $(END)$(RED)Objects Folder$(END)\n' + @$(RM) $(OBJDIRNAME) + +# Clean (make fclean) +fclean: clean + @printf '$(GREY) Removing $(END)$(RED)Program$(END)\n' + @$(RM) $(NAME) + @echo "" + +# Restart (make re) +re: header fclean all + +# Dependences for all +$(NAME): $(OBJ) + @mkdir -p $(OBJDIRNAME) + @printf '$(GREY) Creating $(END)$(GREEN)$(OBJDIRNAME)$(END)\n' + @$(CXX) $(CXXFLAGS) -o $(NAME) $(OBJ) + +# Creating the objects +$(OBJDIRNAME)/%.o: %.cpp + @mkdir -p $(dir $@) + @printf '$(GREY) Compiling $(END)$(GREEN)$<$(END)\n' + @$(CXX) $(CXXFLAGS) -o $@ -c $< + +# Header +header: + @clear + @printf '\n\n' + @printf '$(GOLD) ******* ****** ******* $(END)\n' + @printf '$(GOLD) ****** *** ******* $(END)\n' + @printf '$(GOLD) ******* * ******* $(END)\n' + @printf '$(GOLD) ****** ******* $(END)\n' + @printf '$(GOLD) ******* ******* $(END)\n' + @printf '$(GOLD) ******************* ******* * $(END)\n' + @printf '$(GOLD) ******************* ******* *** $(END)\n' + @printf '$(GOLD) ****** ******* ****** $(END)\n' + @printf '$(GOLD) ****** $(END)\n' + @printf '$(GOLD) ****** $(END)\n' + @printf '$(GREY) Made by rparodi$(END)\n\n' + +# Footer +footer: + @printf "\n" + @printf "$(GOLD) ,_ _,$(END)\n" + @printf "$(GOLD) | \\___//|$(END)\n" + @printf "$(GOLD) |=6 6=|$(END)\n" + @printf "$(GOLD) \\=._Y_.=/$(END)\n" + @printf "$(GOLD) ) \` ( ,$(END)\n" + @printf "$(GOLD) / \\ (('$(END)\n" + @printf "$(GOLD) | | ))$(END)\n" + @printf "$(GOLD) /| | | |\\_//$(END)\n" + @printf "$(GOLD) \\| |._.| |/-\`$(END)\n" + @printf "$(GOLD) '\"' '\"'$(END)\n" + @printf ' $(GREY)The compilation is$(END) $(GOLD)finish$(END)\n $(GREY)Have a good $(END)$(GOLD)correction !$(END)\n' + +clangd: + @echo \ + "CompileFlags:\n" \ + " Add:\n" \ + " - \"-std=c++98 -Wall -Wextra -Werror\"\n" \ + " - \"-I"$(shell pwd)"/includes\"\n" \ + " - \"-xc++\"\n" \ + > .clangd + +# Phony +.PHONY: all bonus clean fclean re clangd +-include ${OBJ:.o=.d} diff --git a/cpp04/ex01/a.out b/cpp04/ex01/a.out new file mode 100755 index 0000000000000000000000000000000000000000..623313169440bc0563c89d2290c624db54f05ab3 GIT binary patch literal 18720 zcmb<-^>JfjWMqH=W(GS35YIsnBH{p{7!n+z3!)Oi&mw_3oPXfeXU|>L}gQ4nRG{{XLArK9+55&fX5A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tZ0B!p6N|=LW!N z*!c)BOF(L2Y!D6VUW3NKVESSE^I4%Ny zf%?Iqu{fwQ2H3bHjE0Rvg6slekQpEvhT|AObMFZE!^ZhwG-#X$q!#9Wm_0BWG}R9p zLxk~R5uULAVM$o&y@o0Pz?YVB?rD8a9pzvmd4(=6}#SX;7Rv zL9{c##zkQ?Y#bG&AEXCee;;_92{Dcf-mnNV3p%a`N}nJu41?@~u|YIsoC={|0jdv1 zgVue3)WI-R8g30}O$sPZK=BJwV*njzgV8Yeg5*FL#)r{!(cBN~=fh}oP~rw@gkqTe zP%gt_H2tt~2pA0=W`-#TpThy?FfcHzgzAUIKl=G0KamxK_6MTzH=^l>jeo&t*f|+6 zZRp{@A5DJ+Xuy(zfdNK?)-u8Lf@oN{f!H7n8V3M{Kg|8G@k1D$08)g6(e1wtU0(%C z+aP7Ic?Q^d9O(AJ_%Ql80|NtS^A$`#Y<#o>w2cWiNDnd?iedU-^k<~J1yTYVCxo4^ z0y|FymcC&6VCi56H2h%p!}hCg&#PcH%-*!Nw083?O_^o`tX=BupQK$H2hN2-$NBvmZ8|G6Sj~T|LOHFufoe zls`dYP~{*YFox+z7YC^YDL|%SX$K?@!zZ8`LE}6iG0?mf$S*MWfY=~$&^SHJ?I1o3 oFEEF&mcTSXxZrb9piD3YDlV|;cY%&iNx~coRt*}HhBBZO0C1j1zyJUM literal 0 HcmV?d00001 diff --git a/cpp04/ex01/main.cpp b/cpp04/ex01/main.cpp new file mode 100644 index 0000000..abfe447 --- /dev/null +++ b/cpp04/ex01/main.cpp @@ -0,0 +1,27 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rparodi +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/01/28 17:08:09 by rparodi #+# #+# */ +/* Updated: 2025/01/30 13:12:32 by rparodi ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "Animal.hpp" +#include "Dog.hpp" +#include "Cat.hpp" + +int main() { + const Animal* meta = new Animal(); + const Animal* j = new Dog(); + const Animal* i = new Cat(); + std::cout << j->getType() << " " << std::endl; + std::cout << i->getType() << " " << std::endl; + i->makeSound(); //will output the cat sound! + j->makeSound(); + meta->makeSound(); + return 0; +}