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 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