     }
     else
     {
-      play_gol();
+      if(play_gol()) //no generation change
+      {
+        if(++same > 50) //no change since 50 runs-> restart
+        {
+          same = 0;
+          init_gol();
+        }
+      }
+      else
+      {
+        same = 0;
+      }
       draw_gol();
     }
 

      if((count == 3) && !alive(x, y))
      {
        frame[x][y] = NEW_CELL; //new cell
      }
      if(((count < 2) || (count > 3)) && alive(x, y))
      {
        frame[x][y] = DEL_CELL; //cell dies
      }
    }
  }

  {
    init_gol();
  }

  return same;
}


