Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f8cabb56a | ||
|
|
67d8fa370d | ||
|
|
5ec8a150cd | ||
|
|
de703651f7 | ||
|
|
d655c852fa |
@@ -86,3 +86,5 @@ dkms.conf
|
|||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
# Custom
|
||||||
|
bin/*
|
||||||
|
|||||||
+6
-2
@@ -2,6 +2,10 @@ FROM gcc:latest
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY bin/Bowling /app/
|
COPY rolls.txt /app/
|
||||||
|
COPY include/* /app/include/
|
||||||
|
COPY src/* /app/src/
|
||||||
|
|
||||||
CMD ["./Bowling"]
|
RUN g++ src/*.cpp -o Bowling
|
||||||
|
|
||||||
|
CMD ["./Bowling", "rolls.txt"]
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
# Bowling
|
# Bowling
|
||||||
|
|
||||||
If you want to try out the project, please use git clone with the HTTPS link to the repo, and not the SSH link, as only the owner can pull and push via SSH.
|
To run the project, simply follow these steps:
|
||||||
|
1. `git clone https://git.rbwr.dk/owner/Bowling.git`
|
||||||
|
2. `docker build -t bowling .`
|
||||||
|
3. `docker run --rm bowling`
|
||||||
|
|
||||||
|
To change bowling score, simply edit the `rolls.txt` file, and build the docker image again.
|
||||||
BIN
Binary file not shown.
@@ -0,0 +1,13 @@
|
|||||||
|
#ifndef FILEHELPER_H
|
||||||
|
#define FILEHELPER_H
|
||||||
|
|
||||||
|
class FileHelper {
|
||||||
|
public:
|
||||||
|
FileHelper();
|
||||||
|
|
||||||
|
~FileHelper();
|
||||||
|
|
||||||
|
static bool FileExists(char *path);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef FILEREADER_H
|
||||||
|
#define FILEREADER_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class FileReader {
|
||||||
|
public:
|
||||||
|
FileReader();
|
||||||
|
|
||||||
|
~FileReader();
|
||||||
|
|
||||||
|
static std::string GetFile(char *path);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef NUMBERHELPER_H
|
||||||
|
#define NUMBERHELPER_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class NumberHelper {
|
||||||
|
public:
|
||||||
|
NumberHelper();
|
||||||
|
|
||||||
|
~NumberHelper();
|
||||||
|
|
||||||
|
static vector<int> GetNumbers(string csv);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef PRINTFRAMES_H
|
||||||
|
#define PRINTFRAMES_H
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class PrintFrames {
|
||||||
|
public:
|
||||||
|
PrintFrames();
|
||||||
|
|
||||||
|
~PrintFrames();
|
||||||
|
|
||||||
|
static void PrintHeader(vector<int> rolls);
|
||||||
|
static void PrintValue(vector<int> rolls);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef SCORECALCULATOR_H
|
||||||
|
#define SCORECALCULATOR_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
class ScoreCalculator {
|
||||||
|
public:
|
||||||
|
ScoreCalculator();
|
||||||
|
|
||||||
|
~ScoreCalculator();
|
||||||
|
|
||||||
|
static int GetScore(vector<int> rolls);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,4 +1 @@
|
|||||||
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
|
|
||||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
|
|
||||||
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 1
|
|
||||||
2, 3, 5, 4, 9, 1, 2, 5, 3, 2, 4, 2, 3, 3, 4, 6, 10, 3, 2
|
2, 3, 5, 4, 9, 1, 2, 5, 3, 2, 4, 2, 3, 3, 4, 6, 10, 3, 2
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "../Include/FileHelper.h"
|
#include "../include/FileHelper.h"
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
FileHelper::FileHelper() {};
|
FileHelper::FileHelper() {};
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "../Include/FileReader.h"
|
#include "../include/FileReader.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../Include/NumberHelper.h"
|
#include "../include/NumberHelper.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
#include "../Include/PrintFrames.h"
|
#include "../include/PrintFrames.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
PrintFrames::PrintFrames() {};
|
PrintFrames::PrintFrames() {};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../Include/ScoreCalculator.h"
|
#include "../include/ScoreCalculator.h"
|
||||||
|
|
||||||
ScoreCalculator::ScoreCalculator() {};
|
ScoreCalculator::ScoreCalculator() {};
|
||||||
ScoreCalculator::~ScoreCalculator() {};
|
ScoreCalculator::~ScoreCalculator() {};
|
||||||
|
|||||||
+5
-5
@@ -1,10 +1,10 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "../Include/FileReader.h"
|
#include "../include/FileReader.h"
|
||||||
#include "../Include/FileHelper.h"
|
#include "../include/FileHelper.h"
|
||||||
#include "../Include/NumberHelper.h"
|
#include "../include/NumberHelper.h"
|
||||||
#include "../Include/ScoreCalculator.h"
|
#include "../include/ScoreCalculator.h"
|
||||||
#include "../Include/PrintFrames.h"
|
#include "../include/PrintFrames.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user