Validate if there are more or less than the allowed rolls, if the numbers are valid and if the number isn't a number.

This commit is contained in:
2025-03-27 15:07:45 +01:00
parent 4a09cbbb33
commit 1228b7150a
6 changed files with 76 additions and 16 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef FILEUTIL_H
#define FILEUTIL_H
#include <string>
#include <vector>
using namespace std;
class FileUtil {
public:
FileUtil() = default;
~FileUtil() = default;
static string getFile(char *path);
static bool fileExists(char *path);
};
#endif
+4 -3
View File
@@ -18,9 +18,10 @@ class NumberHelper {
static vector<Frame> createFrames(vector<int> rolls);
private:
static Frame CreateStrikeFrame(int i);
static Frame CreateFreeFrame(int i, int j);
static Frame CreateBonusFrame(int i, int j, int k);
static Frame createStrikeFrame(int i);
static Frame createFreeFrame(int i, int j);
static Frame createBonusFrame(int i, int j, int k);
static bool isNumber(const std::string& str);
};