You have two related, but distinct, sets of data - the scores and the names.
You could have an array of scores and an array of names. Read/write the scores first, since they are always the same number of bytes each. Then, read/write the names, since they are likely to be different lengths.
Develop a function to get the nth score from EEPROM.
Develop a function to set the nth score in EEPROM.
Develop a function to get the nth name from EEPROM (this will require finding the starting point for the first name, and then the lengths, and new starting points, for each of the names from 0 to n-1 first).
Develop a function to set the nth name in EEPROM. Consider carefully how you will replace "Bob" with "MyNameIsLegend" when Bob is no longer the nth highest scorer.
florenciayannuzzi:
Could you help me with de code? Thanks
I'll help you debug your code. But, you have to take a stab at writing the code. It really isn't that difficult. Start with the function to write the array of scores. Make up an array of values that are somewhat reasonable.
Then, tackle the function to read that array. When you get that done, the other two functions will seem a lot simpler.