Skip to content

Commit 6885131

Browse files
committed
a
1 parent 71d4e24 commit 6885131

File tree

28 files changed

+131
-27
lines changed

28 files changed

+131
-27
lines changed

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
"iomanip": "cpp",
5151
"numbers": "cpp",
5252
"ranges": "cpp",
53-
"sstream": "cpp"
53+
"sstream": "cpp",
54+
"list": "cpp",
55+
"cinttypes": "cpp",
56+
"*.tpp": "cpp",
57+
"stack": "cpp",
58+
"set": "cpp"
5459
}
5560
}

c00/ex00/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := megaphone
55

c00/ex01/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := phonebook
55

c00/ex02/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := account
55

c01/ex00/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := zombie
55

c01/ex01/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := zombie
55

c01/ex02/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := brain
55

c01/ex03/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := human
55

c01/ex04/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := replace
55

c01/ex05/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := harl
55

c01/ex06/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := harlFilter
55

c02/ex00/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := fixed
55

c02/ex01/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := fixed
55

c02/ex02/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := fixed
55

c02/ex03/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := point
55

c03/ex00/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := claptrap
55

c03/ex01/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := scavtrap
55

c03/ex02/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := fragtrap
55

c03/ex03/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := diamondtrap
55

c04/ex00/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := animal
55

c04/ex01/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := animal
55

c04/ex02/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CXX := c++
2-
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
33

44
TARGET := animal
55

c08/ex01/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int main() {
5555
{
5656
Span span5(6);
5757
span5.addNumber(41);
58-
span5.addNumber(42);
58+
span5.addNumber(142);
5959
span5.addNumber(46);
6060

6161
try {
@@ -71,7 +71,7 @@ int main() {
7171
}
7272
}
7373
{
74-
Span span6(15001);
74+
Span span6(15000);
7575
std::vector<int> v(15000);
7676
for (int i = 0; i < 15000; i++) {
7777
v[i] = i;

c08/ex02/main.cpp

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
int main()
44
{
55
{
6-
std::cout << "Testing with MutantStack:" << std::endl;
6+
std::cout << "\033[1;33mTesting with MutantStack:\033[0m" << std::endl;
77

88
MutantStack<int> mstack;
99

@@ -32,7 +32,7 @@ int main()
3232
}
3333
}
3434
{
35-
std::cout << "Testing with List:" << std::endl;
35+
std::cout << "\033[1;33mTesting with List:\033[0m" << std::endl;
3636
std::list<int> mstack;
3737

3838
mstack.push_back(5);
@@ -61,7 +61,7 @@ int main()
6161
}
6262
}
6363
{
64-
std::cout << "Testing with Vector:" << std::endl;
64+
std::cout << "\033[1;33mTesting with Vector:\033[0m" << std::endl;
6565
std::vector<int> mstack;
6666

6767
mstack.push_back(5);
@@ -89,5 +89,34 @@ int main()
8989
++it;
9090
}
9191
}
92+
{
93+
std::cout << "\033[1;33mTesting with Deque:\033[0m" << std::endl;
94+
std::deque<int> mstack;
95+
96+
mstack.push_back(5);
97+
mstack.push_back(17);
98+
99+
std::cout << "Top element: " << mstack.back() << std::endl;
100+
101+
mstack.pop_back();
102+
103+
std::cout << "Size: " << mstack.size() << std::endl;
104+
105+
mstack.push_back(3);
106+
mstack.push_back(5);
107+
mstack.push_back(737);
108+
109+
std::deque<int>::iterator it = mstack.begin();
110+
std::deque<int>::iterator ite = mstack.end();
111+
112+
++it;
113+
--it;
114+
115+
while (it != ite)
116+
{
117+
std::cout << *it << std::endl;
118+
++it;
119+
}
120+
}
92121
return (0);
93122
}

c09/ex00/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
CXX := c++
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
3+
4+
TARGET := form
5+
6+
SRCS := main.cpp \
7+
Bureaucrat.cpp \
8+
Form.cpp
9+
10+
OBJDIR := .obj
11+
OBJS := $(addprefix $(OBJDIR)/,$(SRCS:.cpp=.o))
12+
DEPS := $(addprefix $(OBJDIR)/,$(SRCS:.cpp=.d))
13+
14+
.PHONY: all clean fclean re
15+
16+
all: $(TARGET)
17+
18+
$(TARGET): $(OBJS)
19+
$(CXX) $(CXXFLAGS) $^ -o $@
20+
21+
$(OBJDIR)/:
22+
mkdir -p $(OBJDIR)
23+
24+
$(OBJDIR)/%.o: %.cpp | $(OBJDIR)/
25+
$(CXX) $(CXXFLAGS) -c $< -o $@
26+
27+
clean:
28+
rm -rf $(OBJDIR)
29+
30+
fclean: clean
31+
rm -rf $(TARGET)
32+
33+
re: fclean all
34+
35+
-include $(DEPS)

c09/ex00/main.cpp

Whitespace-only changes.

c09/ex01/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
CXX := c++
2+
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -MMD -MP -pedantic
3+
4+
TARGET := form
5+
6+
SRCS := main.cpp \
7+
Bureaucrat.cpp \
8+
Form.cpp
9+
10+
OBJDIR := .obj
11+
OBJS := $(addprefix $(OBJDIR)/,$(SRCS:.cpp=.o))
12+
DEPS := $(addprefix $(OBJDIR)/,$(SRCS:.cpp=.d))
13+
14+
.PHONY: all clean fclean re
15+
16+
all: $(TARGET)
17+
18+
$(TARGET): $(OBJS)
19+
$(CXX) $(CXXFLAGS) $^ -o $@
20+
21+
$(OBJDIR)/:
22+
mkdir -p $(OBJDIR)
23+
24+
$(OBJDIR)/%.o: %.cpp | $(OBJDIR)/
25+
$(CXX) $(CXXFLAGS) -c $< -o $@
26+
27+
clean:
28+
rm -rf $(OBJDIR)
29+
30+
fclean: clean
31+
rm -rf $(TARGET)
32+
33+
re: fclean all
34+
35+
-include $(DEPS)

c09/ex01/main.cpp

Whitespace-only changes.

0 commit comments

Comments
 (0)