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

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?

Storing the names and scores in two separate Cloud tags is making your life harder, because that requires you to coordinate TWO cloud reads.

You only have one.

You can store an entire table under one tag.

You can not escape learning tables.

i just saw that from here


our lecturer wants us to apply sorting method(can be select, bubble, insert) (so, i guess cant use built-in..

so, i have to move my playername screen to gamescreen?

The only part of that tinywebDB post you need is the updated scores procedure.

Ignore the rest of the post because it's for a different problem.

You can't use start values in Screen 1.

You should close screens as often as you open them.

If you need to pass data across screens, put it in TinyDB.