Added random integer function...
This commit is contained in:
parent
f256842af0
commit
1887bae82a
@ -105,6 +105,10 @@ void fatal_failure (int condition, char * message) {
|
||||
}
|
||||
}
|
||||
|
||||
int random (int minimum, int maximum) {
|
||||
return (rand () % (maximum - minimum + 1) + minimum);
|
||||
}
|
||||
|
||||
void limit (int * value, int minimum, int maximum) {
|
||||
if (value == null) {
|
||||
return;
|
||||
|
@ -81,6 +81,8 @@ extern void echo_byte (int byte);
|
||||
|
||||
extern void fatal_failure (int condition, char * message);
|
||||
|
||||
extern int random (int minimum, int maximum);
|
||||
|
||||
extern void limit (int * value, int minimum, int maximum);
|
||||
|
||||
extern void * allocate (int size);
|
||||
|
Loading…
Reference in New Issue
Block a user