summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--neural.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/neural.c b/neural.c
index 996d5cd..05e7c2b 100644
--- a/neural.c
+++ b/neural.c
@@ -120,7 +120,7 @@ DoNNET(void)
clock_t total_time = 0;
int iterations = 0;
static bool is_adjusted = false;
- static int loops = 1;
+ static int loops = 0;
/*
** Init random number generator.
@@ -151,12 +151,10 @@ DoNNET(void)
** # of loops and increasing the loop count until we
** get a number of loops that we can use.
*/
- for (; loops < LOOP_MAX; loops++) {
- randnum((int32_t)3);
- if(DoNNetIteration(loops) > MINIMUM_TICKS) {
- break;
- }
- }
+ do {
+ randnum(3);
+ ++loops;
+ } while ((DoNNetIteration(loops) <= MINIMUM_TICKS) && (loops < LOOP_MAX));
}
do {