Help me fix some problem for my Sorting (name and score)

Try this

image

Hi, i got same issue after changed to this

first show up this:

after few minutes:
image

Use a different sorting algorithm perhaps.

https://imagnity.com/tutorials/app-inventor/list-sorting-on-app-inventor/

Use this procedure for sorting in both ascending and descending numeral or alpha orders.

1 Like

Post a screenshot of your game page blocks. It isn't logical to wait minutes for the result

image


P.S. These blocks can be dragged directly into your Blocks Editor workspace.

Dragging blocks

1 Like

Maybe it is a clock issue, when game ends should you disable clock ? Set clock enabled and clock always fire to false ? and re enable them when new game starts ?


But i still get the same issues :rofl:


like this? bbut still got same issue:

Asking for the score list from CloudDB then immediately trying to process the top score list is impatient.

Move the processing to where you get the top score list back from CloudDB.

1 Like

I believe is a matter of timing when you update your ListScores, save data to CloudDB and get it back

sorry, i dont understand. Do u mind to explain detail

1 Like


i got the descending order(but i actually need ascending for the only 5 highest score based on the requirement): haha


if use the top5 block, also got the same result. Is there any ideas to limit it to show 5 highest score only

image

With your blocks sequence you get top 5 and then add 0 to list so you have 6 items. Move procedure above set ListView elements

1 Like

Hi, thanks for helping me solve all the problems I encountered. Finally, I've got the results for the top 5 highest scores.

do u think my lecturer wants me to sort the score from highest to lowest /or/ lowest to highest score? This is the requirement mention by him:
-The mobile app shall let the users enter their name if their score is high and going to overwrite one of the 5 highest scores.
-The mobile app shall be able to display the top 5 highest scores in an ascending order

But I feel it is kind of weird if I sort the lowest to highest score order hahha, it doesn't make sense to me

Thanks for helping me, finally i got the result I want :laughing: