From b8e0943b07109314083fa73b6b126ce4914ed7c6 Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Thu, 9 May 2024 14:37:52 +0200 Subject: [PATCH] set rng seed from timestamp --- bingo.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bingo.py b/bingo.py index 1f4eec1..6b5a05b 100644 --- a/bingo.py +++ b/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: