From 0c02b481f69a9bcba24bec066e1430b11adc3141 Mon Sep 17 00:00:00 2001 From: Adam French Date: Fri, 21 Nov 2025 23:36:26 +0000 Subject: [PATCH] random numbers --- html/js/mobile-automata.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/html/js/mobile-automata.mjs b/html/js/mobile-automata.mjs index e03d2cc..89afac7 100644 --- a/html/js/mobile-automata.mjs +++ b/html/js/mobile-automata.mjs @@ -271,7 +271,12 @@ export function cyclicMa(rules, initialState, t) { return states; } -export function renderToCanvas(canvas, width, height, sn = 13252213, dn = 180) { +export function renderToCanvas(canvas, width, height, sn = 0, dn = 180) { + if (sn == 0) { + const min = 1500000; + const max = 2000000; + sn = Math.floor(Math.random() * (max - min + 1)) + min; + } const r = 1; const n = 2 * r + 1; const rules = toMaRule(sn, dn, n, 2);