wte.c: add prototype for random selection

This commit is contained in:
xesc 2024-10-12 21:08:47 +02:00
parent 94ad845dab
commit 49fe655474

View file

@ -2,10 +2,22 @@
#include <stdlib.h>
#include "wte.h"
static size_t get_entry_count()
{
size_t count = 0;
count++;
return count;
}
static int get_proposition()
static int make_suggestion()
{
int ret = 0;
srandom(time(NULL)); // seed random with current time
size_t count = get_entry_count();
if (count) {
size_t choice = random() % count;
printf("choice: %lu", choice);
}
return ret;
}
@ -28,10 +40,10 @@ int main(const int argc, const char **argv)
}
goto exit_main;
}
if (!get_proposition()) {
error("%s", "error");
}
if (make_suggestion()) {
ret = 0;
}
exit_main:
return ret;