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

All in one procedure sort list - get x items - choose ascending/descending order. Blocks draggable

image

1 Like

The order is important.

  • Get the old list
  • add the new score
  • sort the expanded list
  • clip the sorted list to length
  • store the clipped sorted list back in CloudDB
1 Like

can i ask which sorting method is this? is bubble?

Yes

1 Like

tq so much u all are so helpful

1 Like

Extra sort technique samples:

Merge Sort

Insertion Sort

2 Likes

For this app, I ask player name first before they can play the game. Then, I have to sort the player name based on their score marks on result page. Can i ask how to sort the player name based on their score marks.

Here is my PlayerName screen & block:


Here is my Screen1 'GameScreen' (different screen with playername) & block:

See :fu: there is an example

1 Like

A TinyWebDB version with overkill is at

The insertion sort code is near the end of the doc, if you want to skip the fancy parts.

1 Like

Can help me check why got error:
image

This is my PlayerName page:

This is screen1(gamePage): **the png can drag to MIT






Storing names and scores in separate lists leads to madness when it comes time to sort the scores and have the names ride along with the scores.

I would switch to a table (list of lists) like in my TinyDB max scores sample.

The sort comparison would be on the pair item that holds the score.

My top5 procedure works only on one dimensional lists, so fix it or drop it.

You can load your two parallel ListViews in a separate pass over your sorted table, Element by Element.

Also, avoid using multiple screens, if you can.
Stack vertical Arrangements instead, only one Visible at a time.
It avoids the aggravation of having to pass data across screens.

is it possible to keep this and continue edit this(since i don't have much time alrd, tommorow need to submit :nauseated_face:

This is my PlayerName page:

This is screen1(gamePage): **the png can drag to MIT






error:
image

PlayerName page:

This is screen1(gamePage): **the png can drag to MIT






Are you sure that the name's list has the same number of lelements of the HighScore one ?
image
You check for the HighScore list length but you assume that the name's list has the same length: if not, this could cause the error (attempt to access a non-existent value).

SUPPOSELY YES,since player need type name before enter to game page and store their score

Why won't you save Player's name in a list with score 0 when game starts and then update his score in table ? I believe the best solution is to save both names and score in a table and then sort table as already was mentioned in (sos!) Help me fix some problem for my Sorting (name and score) - #47 by ABG. @ABG was kind to provide you an example with TinyWebDB

1 Like

image
can i just igonre all the part of webreturndict?

wait... im so lost right now. can I ask which page I should start actually :sob: :sob: :sob: :sob: :sob: :sob:

Where did THAT come from, using a dictionary?
Those can't be sorted.

Also, is it a firm requirement that you code your own sort instead of calling the built-in AI2 list sort blocks?