From 1a0cf6d95ecb422e73875f50c95ecd118f0debdf Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Tue, 6 Jun 2023 22:51:02 -0700 Subject: [PATCH] Consolidate rng --- index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 4398157..8708657 100644 --- a/index.html +++ b/index.html @@ -160,9 +160,8 @@ const main = document.querySelector('main'); main.insertAdjacentHTML('beforeend', '

'.repeat(20)); - let rng = new Uint16Array(40); // 2 values used per object = 20 total objects - window.crypto.getRandomValues(rng); - rng = [...rng]; // Need to spread to a non-typed array to use .pop() + // Need to spread to a non-typed array to use .pop() + const rng = [...crypto.getRandomValues(new Uint16Array(40))]; // 2 values used per object = 20 total objects // All length units are px const gridRowHeight = 8; -- 2.47.3