diff options
author | Viljami Ilola <+@hix.fi> | 2024-04-08 02:06:05 +0300 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-04-08 02:06:05 +0300 |
commit | eeac2c3bd87c542c48c806a98ea8c7c22db6dfc2 (patch) | |
tree | 37e5077d4dcb1d6d2dc2aefdac6bf792383e76be | |
parent | 3bae12a5c5104e606c6958b8d52ca75c4cbcacba (diff) |
initial highscores
-rw-r--r-- | src/sliceitoff/hiscores/hiscores.py | 4 | ||||
-rw-r--r-- | src/sliceitoff/hiscores/static.py | 25 |
2 files changed, 27 insertions, 2 deletions
diff --git a/src/sliceitoff/hiscores/hiscores.py b/src/sliceitoff/hiscores/hiscores.py index 1b3b87f..a6c2bf0 100644 --- a/src/sliceitoff/hiscores/hiscores.py +++ b/src/sliceitoff/hiscores/hiscores.py @@ -1,7 +1,7 @@ """ hiscores.hiscores - high socres: loading, saving, converting to string""" import os -MAX_HIGHSCORES = 20 +from .static import INITIAL_HIGHSCORES, MAX_HIGHSCORES class HiScores: """ Keeps track of high scores """ @@ -13,7 +13,7 @@ class HiScores: ".config", "sliceitoffrc") if not os.path.isfile(self.config_filename): - self.table=[(0,"") for _ in range(MAX_HIGHSCORES)] + self.table=INITIAL_HIGHSCORES[:] return with open(self.config_filename, "r", encoding="utf-8") as config_file: for line in config_file: diff --git a/src/sliceitoff/hiscores/static.py b/src/sliceitoff/hiscores/static.py new file mode 100644 index 0000000..cf17ba8 --- /dev/null +++ b/src/sliceitoff/hiscores/static.py @@ -0,0 +1,25 @@ +""" hiscores.static - static data of highscores """ +MAX_HIGHSCORES = 20 + +INITIAL_HIGHSCORES = [ + (281238, "HIL"), + (190355, "VIL"), + (164710, "KSU"), + (100000, "---"), + (90000, "---"), + (80000, "-S-"), + (70000, "-L-"), + (60000, "-I-"), + (50000, "-C-"), + (40000, "-E-"), + (30000, "---"), + (25000, "-I-"), + (20000, "-T-"), + (15000, "---"), + (10000, "-O-"), + (8000, "-F-"), + (6000, "-F-"), + (4000, "-!-"), + (2000, "---"), + (0, "---") +] |