"Rotation of a 3D contour" ,"anim4/anim4_gateway.sce"; ..
"Evolution of a 3D surface (plot3d)" ,"anim5/anim5_gateway.sce"; ..
"N link pendulum movement" ,"anim6/anim6_gateway.sce"; ..
- "Shell" ,"anim7/anim7_gateway.sce"];
-
-if ~ usecanvas() then
- subdemolist = [ subdemolist ; "Riemann surface","anim8/anim8_gateway.sce" ];
-end
+ "Shell" ,"anim7/anim7_gateway.sce"; ..
+ "Riemann surface" ,"anim8/anim8_gateway.sce"; ..
+ "Bubble Sort" ,"bubbleSort/bubbleSort_gateway.sce"];
subdemolist(:,2) = demopath + subdemolist(:,2);
clear demopath;
\ No newline at end of file
--- /dev/null
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012-2012 - Scilab Enterprises - Bruno JOFRET
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+//
+//
+function demo_bubbleSort()
+ function res=bubbleSort(in, polyline)
+ for (i = 1:size(in, '*'))
+ for (j = 1:i)
+ if (in(i) < in(j))
+ tmp = in(j);
+ in(j) = in(i);
+ in(i) = tmp;
+ polyline.data(:,2) = in';
+ end
+ end
+ end
+ res = in;
+ endfunction
+
+ nbValues = 200;
+ x = floor(rand(1, nbValues) * nbValues);
+ scf()
+ demo_viewCode(SCI+"/modules/graphics/demos/anim/bubbleSort/bubbleSort.sci");
+ plot(x, "diamond-");
+ a = gca();
+ e = a.children(1).children(1);
+ x = bubbleSort(x, e);
+ delete(gcf())
+endfunction
--- /dev/null
+//
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file is distributed under the same license as the Scilab package.
+//
+
+// =============================================================================
+// Demonstrate animation based on the dynamic of a chain
+// =============================================================================
+
+exec("SCI/modules/graphics/demos/anim/bubbleSort/bubbleSort.sci");
+demo_bubbleSort();
+clear demo_bubbleSort;