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 datetime import datetime
|
||||
import random
|
||||
|
||||
class BingoField(Static):
|
||||
"""A Bingo field widget."""
|
||||
|
||||
cursor_x, cursor_y = 2
|
||||
cursor_x, cursor_y = 2, 2
|
||||
|
||||
class Selected(Message):
|
||||
"""Send message to the board containing clicked field info"""
|
||||
@ -83,8 +86,9 @@ class BingoApp(App):
|
||||
'Gulasch gegessen'
|
||||
]
|
||||
|
||||
# todo: prng stuff
|
||||
import random
|
||||
# get rng seed from current time
|
||||
seed = int(datetime.now().timestamp())
|
||||
random.seed(seed)
|
||||
random.shuffle(fields)
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
|
Loading…
Reference in New Issue
Block a user