From 7d6a4c877de8048ec5fbea4a563b3d09c8976105 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 12 Jan 2020 20:20:12 +0100 Subject: cpp01 00 -> 04 --- cpp01/ex00/Pony.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cpp01/ex00/Pony.cpp (limited to 'cpp01/ex00/Pony.cpp') diff --git a/cpp01/ex00/Pony.cpp b/cpp01/ex00/Pony.cpp new file mode 100644 index 0000000..f521d4b --- /dev/null +++ b/cpp01/ex00/Pony.cpp @@ -0,0 +1,20 @@ +#include +#include "Pony.hpp" + +Pony::Pony(int w, int s) +{ + weight = w; + max_speed = s; +} + +void Pony::say_hello() +{ + std::cout << "Hi, I'm a pony, I weight " << weight + << " and my speed limit is " << max_speed << std::endl; +} + +void Pony::run() +{ + for (int i = 0; i < max_speed; i++) + std::cout << "I'm running really fast at " << i << ", look at me!" << std::endl; +} -- cgit