GNOME Bugzilla – Bug 664948
Add highscore support
Last modified: 2018-05-22 12:23:31 UTC
Hi, I am interested in fixing this bug. So please can you assign this bug to me? Thanks in Advance, Regards, A. Anup.
Hi Anup, sure thing, thanks for working on this. Please be aware that we've been porting Sudoku from Python to Vala, so the branch to be looking at is vala-port, not master. There's Vala code for high score support in several of the Vala games (Mahjongg, Mines, Quadrapassel, ...) so you can copy from any of those to get started.
Hi Michael, can you please tell me where can we find the code for the high scores or can you please provide me the link for that code?
Let's look at Mines. Towards the bottom of gnome-mines.vala you'll find a class ScoresDialog [1]. There's also the History and HistoryEntry classes in history.vala [2]. You can find all the other score-related code just by searching in gnome-mines.vala for "score." [1] https://git.gnome.org/browse/gnome-mines/tree/src/gnome-mines.vala#n870 [2] https://git.gnome.org/browse/gnome-mines/tree/src/history.vala Scores are saved in ~/.local/share/gnome-mines/history. For Sudoku, I think your score will just be how long it takes to solve the puzzle, unless you have a better idea or there's a traditional scoring system. (I'm honestly not very familiar with the game.) There should be separate scores for each difficulty of puzzle, just like Mines has separate scores for different board sizes. Don't hesitate to ask questions here or via email if you run into trouble. Thanks!
We're working on a new scores library and we probably want to use it in Sudoku to track best times, but this is not a priority for 3.14.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-sudoku/issues/3.