All in one procedure sort list - get x items - choose ascending/descending order. Blocks draggable
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
can i ask which sorting method is this? is bubble?
Yes
tq so much u all are so helpful
Extra sort technique samples:
Merge Sort
Insertion Sort
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 there is an example
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.
Can help me check why got error:
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
This is my 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 ?
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
can i just igonre all the part of webreturndict?
wait... im so lost right now. can I ask which page I should start actually
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?