diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..220b6ad --- /dev/null +++ b/.github/workflows/main.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++ GameDie.h -std=c++17 -Wall -Wextra -Werror -o testIO \ No newline at end of file diff --git a/GameDie.cpp b/GameDie.cpp index d512405..6c5de71 100644 --- a/GameDie.cpp +++ b/GameDie.cpp @@ -9,21 +9,25 @@ GameDie::GameDie() srand(time(NULL)); counter.resize(FACES); - for(int i=0; i counter; - const static int FACES = 6; + unsigned int FACES = 6; }; #endif diff --git a/README.md b/README.md index 9a8fe2c..bb054d3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # GameDie +[![Build C++](https://github.com/adrian015/GameDie/actions/workflows/main.yml/badge.svg)](https://github.com/adrian015/GameDie/actions/workflows/main.yml) + This repository provides a class that represents a game die, such as the six-sided dice used in traditional dice game. While the die defaults to six sides, the overloaded constructor allows the developer to customize