diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..25bfe54 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,21 @@ +name: Build C++ + +on: + 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 -o test.o diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml new file mode 100644 index 0000000..a23ec88 --- /dev/null +++ b/.github/workflows/super-linter.yml @@ -0,0 +1,21 @@ +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 -o test.o diff --git a/GameDie.cpp b/GameDie.cpp index d8ecb3a..8dd274c 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -29,7 +29,7 @@ GameDie::GameDie(unsigned int num) { // generate a random number between 1-n where n is the counter size // (inclusive) and return it int GameDie::roll() { - int roll = rand_r() % roll_counter.size(); + int roll = rand() % roll_counter.size(); roll_counter[roll]++; return roll + 1; } diff --git a/README.md b/README.md index d46f7c6..92457d3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![.github/workflows/super-linter.yml](https://github.com/G1411/Roller/actions/workflows/super-linter.yml/badge.svg)](https://github.com/G1411/Roller/actions/workflows/super-linter.yml) # Roller This repository provides a program that rolls a game die, such as the