-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
c++/luhn: 2nd iteration - c header -> c++ header
- Loading branch information
Showing
6 changed files
with
68 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#if !defined(LUHN_HPP) | ||
#define LUHN_HPP | ||
|
||
#include <array> | ||
#include <cctype> | ||
#include <iterator> | ||
#include <numeric> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace luhn { | ||
|
||
bool valid(std::string number); | ||
|
||
bool is_valid_input(std::string sequence); | ||
|
||
int sum(std::array<int, 256> numbers); | ||
|
||
std::array<int, 256> get_numbers(std::string data); | ||
|
||
} // namespace luhn | ||
|
||
#endif // LUHN_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "luhn.h" | ||
#include "luhn.hpp" | ||
#ifdef EXERCISM_TEST_SUITE | ||
#include <catch2/catch.hpp> | ||
#else | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters