This commit is contained in:
Angel Ortigosa Perez
2025-09-07 10:03:17 +02:00
commit 859690063b
30 changed files with 846 additions and 0 deletions

33
ex00/Zombie/Zombie.cpp Normal file
View File

@@ -0,0 +1,33 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Zombie.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/05 16:46:34 by aortigos #+# #+# */
/* Updated: 2025/09/06 01:23:34 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "Zombie.hpp"
Zombie::Zombie()
{
this->name = "NULL";
}
Zombie::~Zombie()
{
std::cout << this->name << " has died.... again..." << std::endl;
}
Zombie::Zombie(std::string str)
{
this->name = str;
}
void Zombie::announce( void )
{
std::cout << this->name << ": BraiiiiiiinnnzzzZ..." << std::endl;
}

34
ex00/Zombie/Zombie.hpp Normal file
View File

@@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Zombie.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/05 16:44:08 by aortigos #+# #+# */
/* Updated: 2025/09/06 01:22:58 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef ZOMBIE_HPP
# define ZOMBIE_HPP
# include <iostream>
class Zombie
{
private:
std::string name;
public:
Zombie();
~Zombie();
Zombie(std::string str);
void announce( void );
};
Zombie* newZombie( std::string name );
void randomChump( std::string name );
#endif

22
ex00/Zombie/newZombie.cpp Normal file
View File

@@ -0,0 +1,22 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* newZombie.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/05 17:04:19 by aortigos #+# #+# */
/* Updated: 2025/09/06 01:19:33 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "Zombie.hpp"
Zombie* newZombie( std::string name )
{
Zombie *z;
z = new Zombie(name);
return (z);
}

View File

@@ -0,0 +1,23 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* randomChump.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/05 17:04:38 by aortigos #+# #+# */
/* Updated: 2025/09/06 01:22:01 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "Zombie.hpp"
void randomChump( std::string name )
{
Zombie *z;
z = new Zombie(name);
z->announce();
}