summaryrefslogtreecommitdiff
path: root/2026/games_submissions/liquidcake/queue.mjs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2026-07-17 15:19:40 -0400
committerLLLL Colonq <llll@colonq>2026-07-17 15:19:40 -0400
commit631fbd3a6567afa5ed9c5f8bb5fe1f32480fabc6 (patch)
treef584b775cb7832448b06cf3c222cc953d160bc91 /2026/games_submissions/liquidcake/queue.mjs
parent07a36f2b38a5cba402ebc5158710f5a85f443456 (diff)
Update
Diffstat (limited to '2026/games_submissions/liquidcake/queue.mjs')
-rw-r--r--2026/games_submissions/liquidcake/queue.mjs30
1 files changed, 0 insertions, 30 deletions
diff --git a/2026/games_submissions/liquidcake/queue.mjs b/2026/games_submissions/liquidcake/queue.mjs
deleted file mode 100644
index e6c3efe..0000000
--- a/2026/games_submissions/liquidcake/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];
- }
-}