This commit is contained in:
2024-02-20 15:35:19 +01:00
parent a5816720e4
commit 93c619a3c7
267 changed files with 10113 additions and 0 deletions

61
cpp00/ex00/Makefile Normal file
View File

@@ -0,0 +1,61 @@
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/12/23 16:15:46 by fgras-ca #+# #+# #
# Updated: 2023/12/23 16:39:11 by fgras-ca ### ########.fr #
# #
# **************************************************************************** #
LOGO = @echo " __, ____, ____, ____, ____ ____, ___, ____,";\
echo "(-| (-/_| (-| \ (-|_, (-|__) (-|_, (- / (-|_,";\
echo " _|__, _/ |, _|__/ _|__, _|__) _|__, _/__, _|__,";\
echo "( ( ( ( ( ( ( ("
DEF_COLOR = \033[0m
GRAY = \033[0;90m
RED = \033[0;91m
GREEN = \033[0;92m
YELLOW = \033[0;93m
BLUE = \033[0;94m
MAGENTA = \033[0;95m
CYAN = \033[0;96m
WHITE = \033[0;97m
ORANGE = \033[38;5;214m
NAME = megaphone
SRC = megaphone.cpp \
OBJS = ${SRC:.cpp=.o}
CC = c++
CFLAGS = -Wall -Werror -Wextra -std=c++98
RM = rm -f
all : $(NAME)
$(NAME) : $(OBJS)
@echo "$(RED)Compilation megaphone... $(DEF_COLOR)"
$(CC) $(CFLAGS) $(OBJS) -o $(NAME)
@echo "$(GREEN)Compilation complete. $(ORANGE)Type "./megaphone" with arguments or not!!$(DEF_COLOR)"
$(LOGO)
clean :
@echo "$(RED)Deleating files objects... $(DEF_COLOR)"
$(RM) $(OBJS)
@echo "$(GREEN)files deleted!! $(DEF_COLOR)"
$(LOGO)
fclean : clean
@echo "$(RED)Delete program name... $(DEF_COLOR)"
$(RM) $(NAME)
@echo "$(GREEN)File program deleted!! $(DEF_COLOR)"
$(LOGO)
re : fclean all
.PHONY : all clean fclean re

BIN
cpp00/ex00/a.out Executable file

Binary file not shown.

BIN
cpp00/ex00/megaphone Executable file

Binary file not shown.

35
cpp00/ex00/megaphone.cpp Normal file
View File

@@ -0,0 +1,35 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* megaphone.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/23 16:14:56 by fgras-ca #+# #+# */
/* Updated: 2023/12/23 16:28:52 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include <iostream>
#include <cctype>
#include <string>
int main(int argc, char **argv)
{
if (argc == 1)
{
std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *" << std::endl;
return (0);
}
for (int i = 1; i < argc; i++)
{
char *str = argv[i];
for (int j = 0; str[j]; j++)
{
std::cout << (char)toupper(str[j]);
}
std::cout << " ";
}
std::cout << std::endl;
return (0);
}

BIN
cpp00/ex00/megaphone.o Normal file

Binary file not shown.