mirror of
https://github.com/Ladebeze66/cpp-partie-2.git
synced 2026-11-09 13:47:14 +01:00
cpp0902
This commit is contained in:
61
cpp09/ex02/Makefile
Normal file
61
cpp09/ex02/Makefile
Normal file
@@ -0,0 +1,61 @@
|
||||
# **************************************************************************** #
|
||||
# #
|
||||
# ::: :::::::: #
|
||||
# Makefile :+: :+: :+: #
|
||||
# +:+ +:+ +:+ #
|
||||
# By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2023/12/27 20:57:42 by fgras-ca #+# #+# #
|
||||
# Updated: 2024/03/06 15:58:19 by fgras-ca ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
LOGO = @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 = pmergeme
|
||||
|
||||
SRC = main.cpp \
|
||||
PmergeMe.cpp \
|
||||
|
||||
CC = c++
|
||||
CFLAGS = -Wall -Werror -Wextra -std=c++98
|
||||
RM = rm -f
|
||||
OBJS = ${SRC:.cpp=.o}
|
||||
|
||||
all : $(NAME)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
$(NAME) : $(OBJS)
|
||||
@echo "$(RED)Compilation fixed... $(DEF_COLOR)"
|
||||
$(CC) $(CFLAGS) $(OBJS) -g -o $(NAME)
|
||||
@echo "$(GREEN)Compilation complete. $(ORANGE)Type "./pmergeme" to execute the program!!$(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
|
||||
0
cpp09/ex02/PmergeMe.cpp
Normal file
0
cpp09/ex02/PmergeMe.cpp
Normal file
42
cpp09/ex02/PmergeMe.hpp
Normal file
42
cpp09/ex02/PmergeMe.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* PmergeMe.hpp :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/06 16:17:28 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/03/06 17:18:48 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef PMERGEME_HPP
|
||||
#define PMERGEME_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
||||
class PmergeMe
|
||||
{
|
||||
public:
|
||||
PmergeMe();
|
||||
~PmergeMe();
|
||||
PmergeMe(const PmergeMe& other);
|
||||
PmergeMe& operator=(const PmergeMe& other);
|
||||
|
||||
void sortAndDisplay(const std::vector<int>& input);
|
||||
void sortAndDisplay(const std::list<int>& input);
|
||||
|
||||
private:
|
||||
template<typename Container>
|
||||
void forJohnsonSort(Container& container);
|
||||
|
||||
template<typename Container>
|
||||
void displaySequence(const Container& sequence, const std::string& prefix);
|
||||
|
||||
template<typename Container>
|
||||
void mesureAndSort(Container& container);
|
||||
};
|
||||
|
||||
#endif
|
||||
0
cpp09/ex02/main.cpp
Normal file
0
cpp09/ex02/main.cpp
Normal file
Reference in New Issue
Block a user