![]() |
Challenge 9 - Quick sort - Printable Version +- Small Basic Forum (https://litdev.uk/mybb) +-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1) +--- Forum: Challenges (https://litdev.uk/mybb/forumdisplay.php?fid=5) +--- Thread: Challenge 9 - Quick sort (/showthread.php?tid=152) |
RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 06:38 PM)jrmrhrb00 Wrote: AB, L-S, Is this code your last code? Code: 'small basic array RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB, Yes. The same code. For the LDArray.sort status is supposed to be a LDArray, but that fails. Maybe it's a code bug in theLitDev extension. JR RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 07:06 PM)jrmrhrb00 Wrote: AB, But in this code, line status[i]=Math.GetRandomNumber(10) is incorrect. There should be line LDArray.SetValue(status, i, Math.GetRandomNumber(10)) instead. RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB, I put that in and it makes no difference. The program runs the same. 'small basic array For i = 1 To 10 name[i]=math.GetRandomNumber(10) LDArray.SetValue(status, i, Math.GetRandomNumber(10)) EndFor The above code is the way that you generate a small basic array which is what this is supposed to do. I know this works. Yours works too, but it didn't fix anything. RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 07:27 PM)jrmrhrb00 Wrote: AB, JR, This is because we haven't fixed all the bugs yet. Please tell us WHAT exactly you want to get as a result of the program work? ![]() RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB, This got started because of the LitDev challenge. Then I used the LDArray.sort option and can't get it to work. JR RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 07:45 PM)jrmrhrb00 Wrote: AB, JR, I see. In this case, your algorithm of actions should be approximately as follows:
AB RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB, Yes. That's the way it should work. JR RE: Challenge 9 - Quick sort - AbsoluteBeginner - 10-28-2024 (10-28-2024, 08:36 PM)jrmrhrb00 Wrote: AB, JR, Okay. But, in your code, you have NOT CREATED an empty LDArray, but are already trying to fill it with random numbers. Missing line: status = LDArray.Create(10) AB RE: Challenge 9 - Quick sort - jrmrhrb00 - 10-28-2024 AB, This is what creates the LDArray 'creates ldArray from indices status=LDArray.CreateFromIndices(name) TextWindow.WriteLine(status) Status even shows you Array1. JR |