Sorting
What is available to do sorting in Matrix Brandy, is there a library for it? This must be a fairly common requirement so I'm hoping there's an off-the-shelf solution.
0
Comments
-
Richard_Russell wrote: »What is available to do sorting in Matrix Brandy?
0 -
Richard_Russell wrote: »What's the solution?
0 -
Back in the day for this size of problem (actually any size) I would probably just code up a bubble sort. And then find out if that's good enough or not - it's only a few lines I think?
Could sortlib be used? If it's not already in Basic, I imagine it could be.0 -
Back in the day for this size of problem (actually any size) I would probably just code up a bubble sort.Could sortlib be used? If it's not already in Basic, I imagine it could be.
In a former life I would have considered trying to write a C sorting library for Matrix Brandy myself, but that boat has sailed. I'd naively assumed that it's such a crucial tool somebody would have already written it.0 -
It seems that no solution for fast sorting in Matrix Brandy is available, or is likely to be in the near future. Here is the program which I was hoping to port (listing at YouTube), perhaps somebody might try adapting it to use a BASIC sort of some kind (preferably something a lot better than a Bubble Sort). Since Brandy is so fast there is a possibility it might still manage 60 fps.
0 -
I'm still on the lookout for a (fast) sorting solution for Matrix Brandy.
Several BASICs have a built-in sort function (for example Liberty BASIC's SORT statement and PureBASIC's SortArray statement). BBC BASIC doesn't, largely (I assume) because using assembler code and the CALL statement is so straightforward, but of course that's not a solution for Matrix Brandy.
Since it's such a common requirement, I would have expected an off-the-shelf solution to have been devised long ago to make it possible to port programs using an assembler-code sort to Brandy BASIC.
0 -
Hated_moron wrote: »I'm still on the lookout for a (fast) sorting solution for Matrix Brandy.
0