From 2cfe157c8b15e37eec0b0820ecca3d97cf2bbb17 Mon Sep 17 00:00:00 2001 From: Angel086 Date: Mon, 20 Feb 2023 11:45:26 -0800 Subject: [PATCH 1/2] Added the feature for issues 1 of the die percentage --- .vscode/launch.json | 7 +++++++ GameDie.cpp | 8 +++++++- Makefile | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..5c7247b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,7 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [] +} \ No newline at end of file diff --git a/GameDie.cpp b/GameDie.cpp index d512405..b3b8d4a 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -12,7 +12,6 @@ GameDie::GameDie() for(int i=0; i GameDie::get_distribution(){ + for(int i=0 ; i0){ + counter[i] = counter[i]/FACES; + }else{ + counter[i] = 0; + } + } return counter; } diff --git a/Makefile b/Makefile index fc44534..af760ff 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ CC=g++ all: - $(CC) -Wall *.cpp \ No newline at end of file + $(CC) -Wall *.cpp From 1337fb7f087bbb4916c3b63c7f9623e5595013cd Mon Sep 17 00:00:00 2001 From: Angel086 <71193325+Angel086@users.noreply.github.com> Date: Mon, 20 Feb 2023 11:55:58 -0800 Subject: [PATCH 2/2] Create c-cpp.yml --- .github/workflows/c-cpp.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/c-cpp.yml diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..b00b272 --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,23 @@ +name: C/C++ CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: configure + run: ./configure + - name: make + run: make + - name: make check + run: make check + - name: make distcheck + run: make distcheck