From 571e967c53b089903a626917b5ceee3fbe4744ff Mon Sep 17 00:00:00 2001 From: Subi Suresh <162290234+Subisuresh321@users.noreply.github.com> Date: Fri, 22 May 2026 16:14:22 +0530 Subject: [PATCH] Add random sequence consistency instructions Added instructions for seeding random number generation. --- wiki/pygbag-code/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wiki/pygbag-code/README.md b/wiki/pygbag-code/README.md index 9ad0213..52a309e 100644 --- a/wiki/pygbag-code/README.md +++ b/wiki/pygbag-code/README.md @@ -214,7 +214,15 @@ import platform # document may not exist on non-emscripten platforms if sys.platform == "emscripten": platform.document.body.style.background = "#404040" -``` +``` +### Getting a consistent random sequence across runs +Call `random.seed()` before any random functions to base the sequence on the current time. + +```py +import random, time +random.seed(time.time()) +``` + ### mobile events handling TODO, drag/drop events, gestures.