diff --git a/src/wte.c b/src/wte.c index 3c784ce..50e6fa5 100644 --- a/src/wte.c +++ b/src/wte.c @@ -2,10 +2,22 @@ #include #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;