summaryrefslogtreecommitdiff
path: root/src/util.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-11-05 22:35:03 -0600
committersanine <sanine.not@pm.me>2023-11-05 22:35:03 -0600
commit639a559dd44d924c6b2e545c7d2eb28b11d4a314 (patch)
treeb204025fca8c4eb695ae49dc98a6f912bbc9b4b5 /src/util.js
parent19d89c43e5552f16080240ebf739cce142515c94 (diff)
begin implementing agent proposals
Diffstat (limited to 'src/util.js')
-rw-r--r--src/util.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.js b/src/util.js
index 4e23d9d..8b85ba7 100644
--- a/src/util.js
+++ b/src/util.js
@@ -14,3 +14,10 @@ export function random_choice(collection, r) {
const idx = Math.floor(collection.length * r);
return collection[idx];
}
+
+
+export function pairs(arr1, arr2) {
+ return arr1
+ .map((x, i) => arr2.map(y => [x, y]))
+ .flat();
+}