Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion GameDie.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down