From f379ed1b86efe73e1eecb871f6f1c53745956d93 Mon Sep 17 00:00:00 2001 From: Sara Date: Thu, 18 Sep 2025 15:32:55 +0200 Subject: [PATCH] chore: moved Dice_Roll to location that matches with the header --- src/dice.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dice.c b/src/dice.c index 6674647..f9e47c0 100644 --- a/src/dice.c +++ b/src/dice.c @@ -1,15 +1,6 @@ #include "dice.h" #include -int Dice_Roll(enum Dice_Die die) { - if (die == COIN) { - return (rand() % 2); - } else { - int const max = die; - return (rand() % max) + 1; - } -} - static int activeDiceCount = 0; static enum Dice_Die activeDice[MAX_ACTIVE_DICE]; @@ -19,6 +10,15 @@ static struct Dice_ResultType rollTotal = { .roll = 0, .string_len = 1, }; +int Dice_Roll(enum Dice_Die die) { + if (die == COIN) { + return (rand() % 2); + } else { + int const max = die; + return (rand() % max) + 1; + } +} + static struct Dice_ResultType Dice_RollToResultType(int roll, enum Dice_Die die) { struct Dice_ResultType result = { };