From 2ee3a711433adf142f6ff1115f7a509efda12f0d Mon Sep 17 00:00:00 2001 From: gabravocorona <111912181+gabravocorona@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:11:58 -0800 Subject: [PATCH 01/10] Create actions.yml --- .github/workflows/actions.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/actions.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..819e806 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,23 @@ +name: Build C++ + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + install: + runs-on: ubuntu-latest + steps: + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y -f build-essential g++ cmake + build: + needs: install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build project + run: g++ main.cpp -std=c++17 -Wall -Wextra -Werror -o firstIO From ca9e51b38703067d1f08667bd09bc020c59632d2 Mon Sep 17 00:00:00 2001 From: gabravocorona <111912181+gabravocorona@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:12:46 -0800 Subject: [PATCH 02/10] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a8fe2c..adaabe9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Build C++](https://github.com/gabravocorona/GameDie/actions/workflows/actions.yml/badge.svg)](https://github.com/gabravocorona/GameDie/actions/workflows/actions.yml) # GameDie This repository provides a class that represents a game die, such as the @@ -23,4 +24,4 @@ Once built, run the image: ...or run it with a bind mount to the current source code: -`docker run --mount type=bind,source="$(pwd)",target=/usr/src -it cpp-container` \ No newline at end of file +`docker run --mount type=bind,source="$(pwd)",target=/usr/src -it cpp-container` From 56fc7e78f41fbd2b54da0e2b4dc79de99ab5e78e Mon Sep 17 00:00:00 2001 From: gabravocorona <111912181+gabravocorona@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:23:45 -0800 Subject: [PATCH 03/10] Update GameDie.h fixed line in .h file --- GameDie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameDie.h b/GameDie.h index 54d69ba..f84b192 100644 --- a/GameDie.h +++ b/GameDie.h @@ -2,7 +2,7 @@ #define GAMEDIE_H #include -using std::vector; +using namespace std; class GameDie { From f54b632486da1dddf7f43cd828d4e81df38eb7f3 Mon Sep 17 00:00:00 2001 From: gabravocorona <111912181+gabravocorona@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:25:49 -0800 Subject: [PATCH 04/10] Update GameDie.cpp fixed line in .cpp file --- GameDie.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GameDie.cpp b/GameDie.cpp index d512405..cdb5878 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -7,9 +7,9 @@ GameDie::GameDie() { srand(time(NULL)); - counter.resize(FACES); + counter.resize(SIDES); - for(int i=0; i Date: Mon, 20 Feb 2023 11:28:14 -0800 Subject: [PATCH 05/10] Update actions.yml changed line --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 819e806..bc3d466 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -20,4 +20,4 @@ jobs: steps: - uses: actions/checkout@v3 - name: Build project - run: g++ main.cpp -std=c++17 -Wall -Wextra -Werror -o firstIO + run: g++ GameDie.cpp -std=c++17 -Wall -Wextra -Werror -o firstIO From d28dca48c45d12d0d606d5cb5ee1f4c01eb76299 Mon Sep 17 00:00:00 2001 From: gabravocorona <111912181+gabravocorona@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:33:29 -0800 Subject: [PATCH 06/10] Update GameDie.cpp Fixed back to FACES --- GameDie.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/GameDie.cpp b/GameDie.cpp index cdb5878..d512405 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -7,9 +7,9 @@ GameDie::GameDie() { srand(time(NULL)); - counter.resize(SIDES); + counter.resize(FACES); - for(int i=0; i Date: Mon, 20 Feb 2023 11:36:27 -0800 Subject: [PATCH 07/10] Update GameDie.cpp changed to roll_counter --- GameDie.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/GameDie.cpp b/GameDie.cpp index d512405..7a45186 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -7,7 +7,7 @@ GameDie::GameDie() { srand(time(NULL)); - counter.resize(FACES); + roll_counter.resize(FACES); for(int i=0; i GameDie::get_distribution(){ - return counter; + return roll_counter; } From a4b7989ee3a5955b42e7a831fa3326d09d2e67fb Mon Sep 17 00:00:00 2001 From: gabravocorona <111912181+gabravocorona@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:38:18 -0800 Subject: [PATCH 08/10] Update GameDie.h changed vec roll_counter --- GameDie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameDie.h b/GameDie.h index f84b192..beb4ff7 100644 --- a/GameDie.h +++ b/GameDie.h @@ -13,7 +13,7 @@ class GameDie vector get_distribution(); private: - vector counter; + vector roll_counter; const static int FACES = 6; }; From 4742999ced447702c64c9e258ed21883832074c8 Mon Sep 17 00:00:00 2001 From: gabravocorona <111912181+gabravocorona@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:40:13 -0800 Subject: [PATCH 09/10] Update GameDie.cpp forgot to fix one line --- GameDie.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameDie.cpp b/GameDie.cpp index 7a45186..e9fb279 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -10,7 +10,7 @@ GameDie::GameDie() roll_counter.resize(FACES); for(int i=0; i Date: Mon, 20 Feb 2023 11:50:21 -0800 Subject: [PATCH 10/10] Update GameDie.h changed back to using std::vec --- GameDie.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameDie.h b/GameDie.h index beb4ff7..939e8f7 100644 --- a/GameDie.h +++ b/GameDie.h @@ -2,7 +2,7 @@ #define GAMEDIE_H #include -using namespace std; +using std::vector; class GameDie {