summaryrefslogtreecommitdiffstats
path: root/labb4/utilities.cpp
blob: a894a3ce5dbb70d908b6387b0d812fcbe7a1dc2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
 * Copyright (C) David Wolfe, 1999.  All rights reserved.
 * Ported to Qt and adapted for TDDD86, 2015.
 */

#include "utilities.h"
#include "constants.h"
#include <cstdlib>
#include <ctime>

void rand_seed() {
    int seed = static_cast<int>(time(0));
    srand(seed);
}

int rand_int(int a, int b) {
    return a + rand() % (b - a + 1);
}