mirror of
https://github.com/onyx-and-iris/lottery-tui.git
synced 2026-02-26 02:59:10 +00:00
sort the numbers before printing them
upd screenshot to reflect sorted results patch bump
This commit is contained in:
parent
84fcbd326a
commit
039487cfc5
BIN
img/tui.png
BIN
img/tui.png
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 23 KiB |
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "lottery-tui"
|
name = "lottery-tui"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
description = "A terminal user interface for lottery games."
|
description = "A terminal user interface for lottery games."
|
||||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||||
dependencies = ["textual>=8.0.0"]
|
dependencies = ["textual>=8.0.0"]
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class Result(NamedTuple):
|
|||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
"""Return a string representation of the lottery result."""
|
"""Return a string representation of the lottery result."""
|
||||||
out = f'Numbers: {", ".join(str(n) for n in self.numbers)}'
|
out = f'Numbers: {", ".join(str(n) for n in sorted(self.numbers))}'
|
||||||
if self.bonus:
|
if self.bonus:
|
||||||
match self.kind:
|
match self.kind:
|
||||||
case 'EuroMillions':
|
case 'EuroMillions':
|
||||||
@ -23,7 +23,7 @@ class Result(NamedTuple):
|
|||||||
bonus_name = 'Thunderball'
|
bonus_name = 'Thunderball'
|
||||||
case _:
|
case _:
|
||||||
bonus_name = 'Bonus Numbers'
|
bonus_name = 'Bonus Numbers'
|
||||||
out += f'\n{bonus_name}: {", ".join(str(n) for n in self.bonus)}'
|
out += f'\n{bonus_name}: {", ".join(str(n) for n in sorted(self.bonus))}'
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user