20 lines
366 B
C
20 lines
366 B
C
#include "time.h"
|
|
#include "stdlib.h"
|
|
#include "dice.h"
|
|
#include "flags.h"
|
|
#include "interactive.h"
|
|
|
|
int main(int argc,const char* argv[]) {
|
|
srand(time(NULL));
|
|
g_argv=argv;
|
|
g_argc=argc;
|
|
process_arg(1);
|
|
// if there are valid dice to roll
|
|
if(f_die>0&&f_num>0) {
|
|
roll_and_print(f_num,f_die);
|
|
}
|
|
if(f_interactive==1||argc==1) {
|
|
return run_interactive();
|
|
}
|
|
}
|