🎉」 init: hello world !

This commit is contained in:
2025-08-02 13:51:40 +02:00
commit 224ed0cf99
44 changed files with 2108 additions and 0 deletions

81
ex02/main.cpp Normal file
View File

@@ -0,0 +1,81 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/19 01:13:45 by mmoussou #+# #+# */
/* Updated: 2025/08/02 13:46:10 by mmoussou ### ########.fr */
/* */
/* ************************************************************************** */
#include "ShrubberyCreationForm.hpp"
#include "RobotomyRequestForm.hpp"
#include "PresidentialPardonForm.hpp"
#include "Bureaucrat.hpp"
int main(void)
{
/*try
{
}
catch (std::exception& e)
{
std::cout << "Exception : " << e.what() << std::endl;
}
std::cout << std::endl;*/
try
{
Bureaucrat knl("Kanel", 145);
Bureaucrat brc("john", 130);
ShrubberyCreationForm s("home");
knl.signForm(s);
brc.executeForm(s);
}
catch (std::exception& e)
{
std::cout << "Exception : " << e.what() << std::endl;
}
std::cout << std::endl;
try
{
Bureaucrat knl("Kanel", 72);
Bureaucrat brc("john", 1);
RobotomyRequestForm s("adjoly");
knl.signForm(s);
std::cout << "50% chances of working, let's test that." << std::endl;
brc.executeForm(s);
brc.executeForm(s);
brc.executeForm(s);
brc.executeForm(s);
brc.executeForm(s);
}
catch (std::exception& e)
{
std::cout << "Exception : " << e.what() << std::endl;
}
std::cout << std::endl;
try
{
Bureaucrat knl("Kanel", 25);
Bureaucrat brc("john", 1);
PresidentialPardonForm s("this one specific person");
knl.signForm(s);
brc.executeForm(s);
}
catch (std::exception& e)
{
std::cout << "Exception : " << e.what() << std::endl;
}
std::cout << std::endl;
}