set rng seed from timestamp
This commit is contained in:
parent
5294ae2bc9
commit
b8e0943b07
10
bingo.py
10
bingo.py
@ -8,10 +8,13 @@ from textual.color import Color
|
|||||||
|
|
||||||
from asyncio import sleep
|
from asyncio import sleep
|
||||||
|
|
||||||
|
from datetime import datetime
|
||||||
|
import random
|
||||||
|
|
||||||
class BingoField(Static):
|
class BingoField(Static):
|
||||||
"""A Bingo field widget."""
|
"""A Bingo field widget."""
|
||||||
|
|
||||||
cursor_x, cursor_y = 2
|
cursor_x, cursor_y = 2, 2
|
||||||
|
|
||||||
class Selected(Message):
|
class Selected(Message):
|
||||||
"""Send message to the board containing clicked field info"""
|
"""Send message to the board containing clicked field info"""
|
||||||
@ -83,8 +86,9 @@ class BingoApp(App):
|
|||||||
'Gulasch gegessen'
|
'Gulasch gegessen'
|
||||||
]
|
]
|
||||||
|
|
||||||
# todo: prng stuff
|
# get rng seed from current time
|
||||||
import random
|
seed = int(datetime.now().timestamp())
|
||||||
|
random.seed(seed)
|
||||||
random.shuffle(fields)
|
random.shuffle(fields)
|
||||||
|
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
|
Loading…
Reference in New Issue
Block a user