summaryrefslogtreecommitdiff
path: root/2026/games/liquidcake1/queue.mjs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-08-26 23:47:59 -0400
committerLLLL Colonq <llll@colonq>2026-08-26 23:47:59 -0400
commit0d2d8cd897e94bd94e0b3ae7c6ce9aa580a44a0a (patch)
treee9039d1c3aedca515d6cb499451d4b73aca4f5fd /2026/games/liquidcake1/queue.mjs
parent242943e5b023ce40eb3be826c418a478d4672f78 (diff)
Add a_tension_span
Diffstat (limited to '2026/games/liquidcake1/queue.mjs')
-rw-r--r--2026/games/liquidcake1/queue.mjs30
1 files changed, 0 insertions, 30 deletions
diff --git a/2026/games/liquidcake1/queue.mjs b/2026/games/liquidcake1/queue.mjs
deleted file mode 100644
index e6c3efe..0000000
--- a/2026/games/liquidcake1/queue.mjs
+++ /dev/null
@@ -1,30 +0,0 @@
-export class Queue {
- /* Structure is a (hopefully short) list of (longer) lists.
- * Queue to the last list.
- * Hold index into first list.
- */
- length = 0;
- index = -1;
- content = [[]];
- max_len = 100;
- push(x) {
- let content = this.content;
- if (content[content.length - 1].length > this.max_len) {
- content.push([]);
- }
- content[content.length - 1].push(x);
- this.length += 1;
- }
- pop() {
- this.index += 1;
- if (this.index >= this.content[0].length) {
- if (this.content.length == 1) {
- throw("empty");
- }
- this.content.shift();
- this.index = 0;
- }
- this.length -= 1;
- return this.content[0][this.index];
- }
-}