Initial Course
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace fundamentals {
|
||||
|
||||
[[nodiscard]] auto join_words(const std::vector<std::string>& words, char separator) -> std::string;
|
||||
[[nodiscard]] auto parse_integers(const std::string& csv) -> std::vector<int>;
|
||||
[[nodiscard]] auto format_score(const std::string& player, int score) -> std::string;
|
||||
|
||||
} // namespace fundamentals
|
||||
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
namespace fundamentals {
|
||||
|
||||
// Return a greeting message for the given name.
|
||||
// Example: greet("Ada") -> "Hello, Ada!"
|
||||
[[nodiscard]] auto greet(const char* name) -> const char*;
|
||||
|
||||
// Return the program entry convention value for success.
|
||||
[[nodiscard]] constexpr auto program_exit_success() -> int { return 0; }
|
||||
|
||||
} // namespace fundamentals
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace fundamentals {
|
||||
|
||||
[[nodiscard]] auto absolute_difference(int lhs, int rhs) -> int;
|
||||
[[nodiscard]] auto is_in_range(int value, int min, int max) -> bool;
|
||||
[[nodiscard]] auto count_set_bits(std::uint8_t value) -> int;
|
||||
[[nodiscard]] auto logical_and(bool lhs, bool rhs) -> bool;
|
||||
[[nodiscard]] auto logical_or(bool lhs, bool rhs) -> bool;
|
||||
|
||||
} // namespace fundamentals
|
||||
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace fundamentals {
|
||||
|
||||
[[nodiscard]] auto add_integers(int lhs, int rhs) -> int;
|
||||
[[nodiscard]] auto multiply_doubles(double lhs, double rhs) -> double;
|
||||
[[nodiscard]] auto is_even(std::int64_t value) -> bool;
|
||||
[[nodiscard]] auto describe_type(int value) -> std::string;
|
||||
[[nodiscard]] auto describe_type(double value) -> std::string;
|
||||
[[nodiscard]] auto describe_type(bool value) -> std::string;
|
||||
|
||||
} // namespace fundamentals
|
||||
Reference in New Issue
Block a user