How to implement debugging-like breakpoint into program
Hi, i'm looking for some expert's help on this one, i'll briefly try to explain what i'm trying to do:
For programming class i got to prepare a project that demonstrates QuickSort algorythm. This means i have to create an animation that simulates the sorting process: the elements in the array to be sorted, the swapping of elements in each partition (i'm implementing "in place quicksort" algorythm).
The animation runs ok, i'm using labels to depict each number in the array to be sorted, but my problem is the one requirement that sais that my program should implement pausing and step-by-step runnning of the animation and various speed settings.
Code:
public void _swapBars(int L ,int H)
{
int i;
Bar low = (Bar)(bare[L]);//Bar object is a control that inherits Label
Bar high = (Bar)(bare[H]);
int posHigh = high.Left ;
for (i=0;i<120;i++)
{
low.Top--;
high.Top--;
};
if (L!=H)
{
do
{
low.Left++ ;
high.Left--;
}while (low.Left<posHigh);
}
for (i=0;i<120;i++)
{
low.Top++;
high.Top++;
}
bare[L]=high;
bare[H]=low;
}
Where should i look into so i can control the speed of the animation and the breakpoint-like runnning mode ?
something similar to what i'm looking for is presented on this page:
http://ciips.ee.uwa.edu.au/~morris/Y...0/qsort1a.html
check for the [view animation] button located on the bottom of the page.