diff src/rovascope/actuatorbin.c @ 410:4333f0bbcc55 trunk

[svn] - select waves randomly
author nenolod
date Sat, 06 Jan 2007 02:00:15 -0800
parents 2bf7e2965eec
children 37a183b4ce60
line wrap: on
line diff
--- a/src/rovascope/actuatorbin.c	Sat Jan 06 01:59:37 2007 -0800
+++ b/src/rovascope/actuatorbin.c	Sat Jan 06 02:00:15 2007 -0800
@@ -35,18 +35,12 @@
 rovascope_get_random_normal_scope(void)
 {
    struct pn_actuator *out;
-   static gint ret = 0;
 
    gchar *candidates[] = {
       "wave_horizontal", "wave_vertical", "wave_radial",
    };
 
-   if (ret >= G_N_ELEMENTS(candidates))
-       ret = 0;
-
-   out = create_actuator(candidates[ret]);
-
-   ret++;
+   out = create_actuator(candidates[rand() % G_N_ELEMENTS(candidates)]);
 
    return out;
 }