From 102f57932a5ff8ef5f91d6d1677f19af8f60988c Mon Sep 17 00:00:00 2001
From: TKHR-Shiu
Date: Thu, 7 May 2026 17:54:47 +0900
Subject: [PATCH 1/6] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=95=E3=83=AA?=
=?UTF-8?q?=E3=82=AF=E3=83=88=E5=AF=BE=E5=BF=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/lib/icemake.ts | 95 +++++++------
app/stages.ts | 325 +++++++++++++++++++++++++++++++++------------
2 files changed, 298 insertions(+), 122 deletions(-)
diff --git a/app/lib/icemake.ts b/app/lib/icemake.ts
index 7611145..b32434b 100644
--- a/app/lib/icemake.ts
+++ b/app/lib/icemake.ts
@@ -8,7 +8,7 @@ export type ComponentGraphNode = {
export type ExecutionStep = {
componentIndex: number;
- stack: Flavor[];
+ stack: Flavor[] | null; // コーンが食べられたらnull
branchTaken?: boolean;
};
@@ -17,6 +17,7 @@ export type IcemakeResult = {
traces: { color: ConeColor; steps: ExecutionStep[] }[];
};
+// 1つのコーンに積めるアイスの最大数(UI上の想定に合わせた安全上限)
const MAX_ICE_STACK_SIZE = 10;
export function icemake(
@@ -28,6 +29,7 @@ export function icemake(
const stageData = STAGES[stage];
if (!stageData) return { result: {}, traces: [] };
+ // グラフが渡されたときは、各色ごとに実行トレースを取りながら結果を計算する
if (graph && firstComponentId !== undefined) {
const traces = colors.map((color) => {
const steps = runGraphExecution(
@@ -38,16 +40,18 @@ export function icemake(
);
return { color, steps };
});
+ // 最終ステップのstackをその色の完成結果として採用する
const result = Object.fromEntries(
traces.map(({ color, steps }) => [
color,
- steps.length > 0 ? steps[steps.length - 1].stack : [],
+ steps.length > 0 ? (steps[steps.length - 1].stack ?? []) : [],
]),
);
return { result, traces };
}
return {
+ // グラフ未実行時はステージ定義のミッションを既定値として返す
result: Object.fromEntries(
colors.map((color) => [color, stageData.mission[color] ?? []]),
),
@@ -61,14 +65,13 @@ function runGraphExecution(
graph: Record,
firstComponentId: number,
): ExecutionStep[] {
- const stack: Flavor[] = [];
+ // コーンが食べられたらnull
+ let stack: Flavor[] | null = [];
const steps: ExecutionStep[] = [];
+ // 同じノード + 同じstack状態に再訪したら無限ループとみなして停止する
const visited: Map> = new Map();
let currentId: number | null = firstComponentId;
- const coneColors: ConeColor[] = ["red", "yellow", "brown"];
- const flavors: Flavor[] = ["vanilla", "chocolate", "strawberry"];
-
while (currentId !== null) {
const component: Component | undefined = components[currentId];
const node: ComponentGraphNode | undefined = graph[currentId];
@@ -80,14 +83,17 @@ function runGraphExecution(
if (!componentVisited || componentVisited.has(stackKey)) break;
componentVisited.add(stackKey);
+ if (!stack) break;
+
switch (component.type) {
case "push":
if (stack.length < MAX_ICE_STACK_SIZE) stack.push(component.flavor);
break;
case "pop":
- if (
- stack.length > 0 &&
- (!component.flavor || stack[stack.length - 1] === component.flavor)
+ if (stack.length === 0) stack = null;
+ else if (
+ !component.flavor ||
+ stack[stack.length - 1] === component.flavor
)
stack.pop();
break;
@@ -95,42 +101,57 @@ function runGraphExecution(
break;
}
- const children: ComponentGraphNode["childrenIds"] = node.childrenIds;
-
- let branchTaken: boolean | undefined;
- if (children != null && typeof children !== "number") {
- let condition = false;
- if (component.type === "if") {
- const cond: ConeColor | Flavor[] | number =
- component.condition;
- if (typeof cond === "string") {
- condition = color === cond;
- } else if (Array.isArray(cond)) {
- for (let i = 0; i <= stack.length - cond.length; i++) {
- if (
- stack.slice(i, i + cond.length).every((f, j) => f === cond[j])
- ) {
- condition = true;
- break;
+ if (!stack) {
+ steps.push({
+ componentIndex: currentId,
+ stack: null,
+ branchTaken: undefined,
+ });
+ } else {
+ const children: ComponentGraphNode["childrenIds"] = node.childrenIds;
+
+ let branchTaken: boolean | undefined;
+ if (children != null && typeof children !== "number") {
+ let condition = false;
+ // ifノードの条件を、色 / 部分配列一致 / 個数で評価する
+ if (component.type === "if") {
+ const cond: ConeColor | Flavor[] | number =
+ component.condition;
+ if (typeof cond === "string") {
+ condition = color === cond;
+ } else if (Array.isArray(cond)) {
+ for (let i = 0; i <= stack.length - cond.length; i++) {
+ if (
+ stack.slice(i, i + cond.length).every((f, j) => f === cond[j])
+ ) {
+ condition = true;
+ break;
+ }
}
+ } else if (typeof cond === "number") {
+ condition = stack.length >= cond;
}
- } else if (typeof cond === "number") {
- condition = stack.length >= cond;
}
+ branchTaken = condition;
}
- branchTaken = condition;
- }
- steps.push({ componentIndex: currentId, stack: [...stack], branchTaken });
+ steps.push({
+ componentIndex: currentId,
+ stack: stack === null ? null : [...stack],
+ branchTaken,
+ });
- if (children == null) break;
+ if (children == null) break;
- if (typeof children === "number") {
- currentId = children;
- } else {
- currentId = branchTaken ? children.true : children.false;
+ if (typeof children === "number") {
+ // 直線接続
+ currentId = children;
+ } else {
+ // 分岐接続(true/false)
+ currentId = branchTaken ? children.true : children.false;
+ }
}
}
return steps;
-}
+}
\ No newline at end of file
diff --git a/app/stages.ts b/app/stages.ts
index cc04d50..e3260ae 100644
--- a/app/stages.ts
+++ b/app/stages.ts
@@ -12,6 +12,60 @@ export type StageData = {
export const STAGES: Record = {
1: {
+ mission: {
+ red: ["vanilla"],
+ },
+ components: [{ type: "push", flavor: "vanilla" }],
+ },
+ 2: {
+ mission: {
+ red: ["chocolate", "vanilla", "strawberry"],
+ },
+ components: [
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ ],
+ },
+ 3: {
+ mission: {
+ red: ["strawberry", "vanilla"],
+ yellow: ["strawberry", "chocolate"],
+ },
+ components: [
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: "red" },
+ ],
+ },
+ 4: {
+ mission: {
+ red: ["vanilla"],
+ yellow: ["chocolate"],
+ brown: ["strawberry"],
+ },
+ components: [
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: "red" },
+ { type: "if", condition: "brown" },
+ ],
+ },
+ 5: {
+ mission: {
+ red: ["vanilla", "chocolate", "strawberry"],
+ yellow: ["chocolate", "strawberry"],
+ },
+ components: [
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: "red" },
+ ],
+ },
+ 6: {
mission: {
red: ["vanilla", "chocolate"],
yellow: ["strawberry", "vanilla"],
@@ -25,49 +79,49 @@ export const STAGES: Record = {
{ type: "pop", flavor: undefined },
],
},
- 2: {
+ 7: {
mission: {
red: ["chocolate"],
yellow: ["vanilla", "strawberry"],
- brown: ["vanilla", "chocolate"]
+ brown: ["vanilla", "chocolate"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "push", flavor: "strawberry"},
- {type: "if", condition: "red"},
- {type: "if", condition: "yellow"},
- {type: "pop", flavor: undefined},
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: "red" },
+ { type: "if", condition: "yellow" },
+ { type: "pop", flavor: undefined },
],
},
- 3: {
+ 8: {
mission: {
- red: ["chocolate", "vanilla", "chocolate"],
- yellow: ["vanilla", "vanilla", "vanilla"],
+ red: ["vanilla", "vanilla", "vanilla"],
+ yellow: ["chocolate", "chocolate", "chocolate"],
+ brown: ["strawberry", "strawberry", "strawberry"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "if", condition: "yellow"},
- {type: "if", condition: 3},
-
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: "red" },
+ { type: "if", condition: "brown" },
+ { type: "if", condition: 3 },
],
},
- 4: {
+ 9: {
mission: {
- red: ["vanilla", "chocolate", "vanilla", "chocolate"],
- yellow: ["chocolate", "vanilla", "chocolate", "chocolate"],
+ red: ["chocolate", "vanilla", "chocolate"],
+ yellow: ["vanilla", "vanilla", "vanilla"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "push", flavor: "chocolate"},
- {type: "if", condition: "yellow"},
- {type: "if", condition: 4},
-
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "if", condition: "yellow" },
+ { type: "if", condition: 3 },
],
},
- 11: {
+ 10: {
mission: {
red: ["strawberry", "vanilla", "strawberry", "vanilla", "vanilla"],
yellow: ["strawberry", "vanilla", "strawberry", "vanilla", "chocolate"],
@@ -81,83 +135,166 @@ export const STAGES: Record = {
{ type: "if", condition: "red" },
],
},
- 12: {
+ 11: {
mission: {
- red: ["vanilla", "chocolate", "vanilla"],
- yellow: ["vanilla", "vanilla", "chocolate"]
+ red: ["vanilla", "chocolate", "vanilla", "chocolate"],
+ yellow: ["chocolate", "vanilla", "chocolate", "chocolate"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "push", flavor: "chocolate"},
- {type: "if", condition: "red"},
- {type: "if", condition: ["vanilla", "vanilla"]},
- {type: "pop", flavor: "chocolate"}
- ]
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "chocolate" },
+ { type: "if", condition: "yellow" },
+ { type: "if", condition: 4 },
+ ],
},
- 13: {
+ 12: {
mission: {
red: ["chocolate", "strawberry", "vanilla"],
- yellow: [ "strawberry", "vanilla","chocolate"],
- brown: [ "vanilla","chocolate", "strawberry"],
+ yellow: ["strawberry", "vanilla", "chocolate"],
+ brown: ["vanilla", "chocolate", "strawberry"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "push", flavor: "strawberry"},
- {type: "if", condition: "red"},
- {type: "if", condition: "yellow"},
- {type: "if", condition: 3},
- {type: "if", condition: 3},
- {type: "if", condition: 3},
- ]
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: "red" },
+ { type: "if", condition: "yellow" },
+ { type: "if", condition: 3 },
+ { type: "if", condition: 3 },
+ { type: "if", condition: 3 },
+ ],
},
14: {
mission: {
- red: ["vanilla", "vanilla", "vanilla"],
- yellow: ["chocolate", "chocolate", "chocolate"],
- brown: ["strawberry", "strawberry", "strawberry"]
+ red: ["vanilla", "chocolate", "vanilla"],
+ yellow: ["vanilla", "vanilla", "chocolate"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "push", flavor: "strawberry"},
- {type: "if", condition: "red"},
- {type: "if", condition: "brown"},
- {type: "if", condition: 3}
- ]
-}, 15: {
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "chocolate" },
+ { type: "if", condition: "red" },
+ { type: "if", condition: ["vanilla", "vanilla"] },
+ { type: "pop", flavor: undefined },
+ ],
+ },
+ 15: {
mission: {
- red: ["chocolate", "strawberry", "chocolate", "vanilla"],
- yellow: ["chocolate", "strawberry", "chocolate", "strawberry", "chocolate", "strawberry", "vanilla"]
+ red: ["chocolate", "vanilla", "chocolate", "strawberry"],
+ yellow: ["vanilla", "strawberry", "chocolate"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "push", flavor: "strawberry"},
- {type: "if", condition: 6},
- {type: "if", condition: "red"},
- {type: "if", condition: ["strawberry", "chocolate", "strawberry"]},
- {type: "pop", flavor: undefined}
- ]
-},
+ { type: "if", condition: "red" },
+ { type: "if", condition: 3 },
+ { type: "if", condition: ["chocolate", "vanilla"] },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "push", flavor: "vanilla" },
+ ],
+ },
16: {
mission: {
- red: ["chocolate", "strawberry" ,"chocolate", "strawberry", "chocolate", "strawberry"],
+ red: ["chocolate", "vanilla", "strawberry", "vanilla"],
+ yellow: ["strawberry", "vanilla", "chocolate", "vanilla"],
+ },
+ components: [
+ { type: "if", condition: "yellow" },
+ { type: "if", condition: 3 },
+ { type: "if", condition: ["strawberry", "vanilla"] },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "push", flavor: "vanilla" },
+ ],
+ },
+ 17: {
+ mission: {
+ red: ["chocolate", "strawberry", "chocolate", "vanilla"],
+ yellow: [
+ "chocolate",
+ "strawberry",
+ "chocolate",
+ "strawberry",
+ "chocolate",
+ "strawberry",
+ "vanilla",
+ ],
+ },
+ components: [
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: 6 },
+ { type: "if", condition: "red" },
+ { type: "if", condition: ["strawberry", "chocolate", "strawberry"] },
+ { type: "pop", flavor: undefined },
+ ],
+ },
+ 18: {
+ mission: {
+ red: [
+ "chocolate",
+ "vanilla",
+ "strawberry",
+ "chocolate",
+ "vanilla",
+ "strawberry",
+ ],
+ yellow: [
+ "vanilla",
+ "strawberry",
+ "chocolate",
+ "vanilla",
+ "strawberry",
+ "chocolate",
+ ],
+ brown: [
+ "strawberry",
+ "chocolate",
+ "vanilla",
+ "strawberry",
+ "chocolate",
+ "vanilla",
+ ],
+ },
+ components: [
+ { type: "if", condition: "yellow" },
+ { type: "if", condition: "red" },
+ { type: "if", condition: 6 },
+ { type: "if", condition: 7 },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "push", flavor: "vanilla" },
+ { type: "pop", flavor: "chocolate" },
+ { type: "pop", flavor: "vanilla" },
+ ],
+ },
+ 19: {
+ mission: {
+ red: [
+ "chocolate",
+ "strawberry",
+ "chocolate",
+ "strawberry",
+ "chocolate",
+ "strawberry",
+ ],
yellow: ["strawberry", "chocolate", "vanilla", "strawberry"],
- brown: ["chocolate", "vanilla", "strawberry"]
+ brown: ["chocolate", "vanilla", "strawberry"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
- {type: "push", flavor: "strawberry"},
- {type: "if", condition: "red"},
- {type: "if", condition: "yellow"},
- {type: "if", condition: ["vanilla"]},
- {type: "if", condition: 5},
- ]
-},
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "if", condition: "red" },
+ { type: "if", condition: "yellow" },
+ { type: "if", condition: ["vanilla"] },
+ { type: "if", condition: 5 },
+ ],
+ },
20: {
mission: {
red: ["vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla"],
@@ -175,7 +312,8 @@ export const STAGES: Record = {
{type: "if", condition: 4},
{type: "if", condition: 8},
]
-},
+ },
+
21: {
mission: {
red: ["vanilla", "strawberry", "chocolate", "vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry"],
@@ -193,5 +331,22 @@ export const STAGES: Record = {
{type: "if", condition: 5},
{type: "if", condition: 8},
]
-},
-};
+ },
+ 24: {
+ mission: {
+ red: ["chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "strawberry"],
+ yellow: ["vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "strawberry", "strawberry"],
+ brown: ["vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla",],
+ },
+ components: [
+ { type: "if", condition: "red" },
+ { type: "if", condition: "brown" },
+ { type: "if", condition: 7 },
+ { type: "if", condition: 9 },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "vanilla" },
+ ],
+ },
+};
\ No newline at end of file
From da1767c1a3b7b341963466b24f32ded128eefb27 Mon Sep 17 00:00:00 2001
From: TKHR-Shiu
Date: Thu, 7 May 2026 18:00:15 +0900
Subject: [PATCH 2/6] =?UTF-8?q?=E3=82=B9=E3=83=86=E3=83=BC=E3=82=B8?=
=?UTF-8?q?=E6=83=85=E5=A0=B1=E3=81=AE=E9=A0=86=E7=95=AA=E5=85=A5=E3=82=8C?=
=?UTF-8?q?=E6=9B=BF=E3=81=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/stages.ts | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/app/stages.ts b/app/stages.ts
index e3260ae..0afe015 100644
--- a/app/stages.ts
+++ b/app/stages.ts
@@ -295,6 +295,24 @@ export const STAGES: Record = {
{ type: "if", condition: 5 },
],
},
+ 24: {
+ mission: {
+ red: ["chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "strawberry"],
+ yellow: ["vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "strawberry", "strawberry"],
+ brown: ["vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla",],
+ },
+ components: [
+ { type: "if", condition: "red" },
+ { type: "if", condition: "brown" },
+ { type: "if", condition: 7 },
+ { type: "if", condition: 9 },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "vanilla" },
+ ],
+ },
+
20: {
mission: {
red: ["vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla"],
@@ -332,21 +350,4 @@ export const STAGES: Record = {
{type: "if", condition: 8},
]
},
- 24: {
- mission: {
- red: ["chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "strawberry"],
- yellow: ["vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "strawberry", "strawberry"],
- brown: ["vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla",],
- },
- components: [
- { type: "if", condition: "red" },
- { type: "if", condition: "brown" },
- { type: "if", condition: 7 },
- { type: "if", condition: 9 },
- { type: "push", flavor: "chocolate" },
- { type: "push", flavor: "strawberry" },
- { type: "push", flavor: "vanilla" },
- { type: "push", flavor: "vanilla" },
- ],
- },
};
\ No newline at end of file
From 52dc1b36b4ba9503ce45012f652a2b96d3da4aa3 Mon Sep 17 00:00:00 2001
From: TKHR-Shiu
Date: Fri, 8 May 2026 18:49:36 +0900
Subject: [PATCH 3/6] =?UTF-8?q?=E3=82=B9=E3=83=86=E3=83=BC=E3=82=B8?=
=?UTF-8?q?=E7=95=AA=E5=8F=B7=E3=81=AE=E6=95=B4=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/stages.ts | 60 +++++++++++++++++++++++++--------------------------
1 file changed, 29 insertions(+), 31 deletions(-)
diff --git a/app/stages.ts b/app/stages.ts
index 0afe015..c2869ec 100644
--- a/app/stages.ts
+++ b/app/stages.ts
@@ -165,6 +165,23 @@ export const STAGES: Record = {
{ type: "if", condition: 3 },
],
},
+ 13: {
+ mission: {
+ red: ["chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "strawberry"],
+ yellow: ["vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "strawberry", "strawberry"],
+ brown: ["vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla",],
+ },
+ components: [
+ { type: "if", condition: "red" },
+ { type: "if", condition: "brown" },
+ { type: "if", condition: 7 },
+ { type: "if", condition: 9 },
+ { type: "push", flavor: "chocolate" },
+ { type: "push", flavor: "strawberry" },
+ { type: "push", flavor: "vanilla" },
+ { type: "push", flavor: "vanilla" },
+ ],
+ },
14: {
mission: {
red: ["vanilla", "chocolate", "vanilla"],
@@ -295,58 +312,39 @@ export const STAGES: Record = {
{ type: "if", condition: 5 },
],
},
- 24: {
- mission: {
- red: ["chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "chocolate", "vanilla", "strawberry"],
- yellow: ["vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "vanilla", "strawberry", "strawberry"],
- brown: ["vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla", "vanilla", "chocolate", "vanilla",],
- },
- components: [
- { type: "if", condition: "red" },
- { type: "if", condition: "brown" },
- { type: "if", condition: 7 },
- { type: "if", condition: 9 },
- { type: "push", flavor: "chocolate" },
- { type: "push", flavor: "strawberry" },
- { type: "push", flavor: "vanilla" },
- { type: "push", flavor: "vanilla" },
- ],
- },
-
- 20: {
+20: {
mission: {
- red: ["vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla"],
- yellow: ["strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla", "strawberry", "chocolate", "vanilla"],
- brown: ["vanilla", "strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla", "strawberry", "chocolate", "vanilla"],
+ red: ["vanilla", "strawberry", "chocolate", "vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry"],
+ yellow: ["chocolate", "vanilla", "strawberry", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry"],
+ brown: ["strawberry", "chocolate", "vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry"],
},
components: [
- {type: "push", flavor: "vanilla"},
- {type: "push", flavor: "chocolate"},
{type: "push", flavor: "vanilla"},
{type: "push", flavor: "chocolate"},
{type: "push", flavor: "strawberry"},
{type: "if", condition: "red"},
{type: "if", condition: "yellow"},
+ {type: "if", condition: 3},
{type: "if", condition: 4},
+ {type: "if", condition: 5},
{type: "if", condition: 8},
]
},
-
-21: {
+ 21: {
mission: {
- red: ["vanilla", "strawberry", "chocolate", "vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry"],
- yellow: ["chocolate", "vanilla", "strawberry", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry"],
- brown: ["strawberry", "chocolate", "vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry"],
+ red: ["vanilla", "chocolate", "strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla"],
+ yellow: ["strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla", "strawberry", "chocolate", "vanilla"],
+ brown: ["vanilla", "strawberry", "vanilla", "chocolate", "strawberry", "chocolate", "vanilla", "strawberry", "chocolate", "vanilla"],
},
components: [
+ {type: "push", flavor: "vanilla"},
+ {type: "push", flavor: "chocolate"},
{type: "push", flavor: "vanilla"},
{type: "push", flavor: "chocolate"},
{type: "push", flavor: "strawberry"},
{type: "if", condition: "red"},
{type: "if", condition: "yellow"},
- {type: "if", condition: 3},
{type: "if", condition: 4},
- {type: "if", condition: 5},
{type: "if", condition: 8},
]
},
From 1b5336f93121b8cb25d511f20a207326ff67ab13 Mon Sep 17 00:00:00 2001
From: TKHR-Shiu
Date: Fri, 8 May 2026 18:50:49 +0900
Subject: [PATCH 4/6] =?UTF-8?q?=E9=81=8A=E3=81=B3=E6=96=B9=E3=83=9A?=
=?UTF-8?q?=E3=83=BC=E3=82=B8=E3=81=AE=E5=A4=89=E6=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/routes/howToPlay.tsx | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/app/routes/howToPlay.tsx b/app/routes/howToPlay.tsx
index 59881cf..b6aff66 100644
--- a/app/routes/howToPlay.tsx
+++ b/app/routes/howToPlay.tsx
@@ -63,7 +63,7 @@ export default function HowToPlay() {
この画面には、プレイに必要なさまざまな情報が表示されています。
- 左上には、そのステージのミッション(作りたいアイスクリーム)が書かれています。
+ 左上には、そのステージの番号やミッション(作りたいアイスクリーム)が書かれています。
このミッションを達成できるよう、人々を上手に配置しましょう。
@@ -80,6 +80,9 @@ export default function HowToPlay() {
画面下には、このステージで作業してくれる人たちが並んでいます。
作業に参加させたい人がいたら、ドラッグ&ドロップで好きな場所に配置できます。
+ 配置した人々は、その下にあるベルトコンベアを別の人やコーン投入口と繋げることで、アイスクリーム作りを手伝ってくれます。
+ ベルトコンベアの端をクリックしたまま、別のベルトコンベアの端まで持っていくことでつなげることができます。
+ 配置した人々や、つなげた経路はホバーして出てくる×ボタンで消すことができます。

@@ -95,6 +98,7 @@ export default function HowToPlay() {
右下には「実行」ボタンがあります。
配置が整ったと思ったら、このボタンを押してみましょう。押すと、さまざまな色のコーンが流れてきます。
+ スピードを変えたいときは、実行ボタンの隣にあるボタンを押すことにより、速くしたり遅くしたりできます。
お題どおりのアイスを作ることができれば成功です。
@@ -192,8 +196,7 @@ export default function HowToPlay() {
- ・ Ⅰ:コーンの色
- ・ Ⅱ:載っているアイスの数
- - ・ Ⅲ:一番上に載っているアイスの種類
- - ・ Ⅳ:特定のアイスの並び順の有無
+ - ・ Ⅲ:特定のアイスの並び順の有無
それぞれの条件に従って、コーンを上下どちらかの経路へ流します。
@@ -219,13 +222,9 @@ export default function HowToPlay() {
この人たちは、特定の味のアイスが大好きです。
その味のアイスが一番上に載ったコーンが流れてくると、一番上のアイスを食べてしまいます。
-
ただし、
-
- - ・ アイスが1つも載っていない
- - ・ 一番上のアイスが好きな味ではない
-
-
- といった場合は、何もしません。
+
ただし、
+ 一番上のアイスが好きな味ではない場合は、何もしません。
+ しかし、アイスが1つも載っていないコーンが流れてきたときは、コーンを食べてしまいます。
※黒い服の人は、どんな味も大好きです!
From dc65fc2132a0c684d877bb6a13ed02e307378ac3 Mon Sep 17 00:00:00 2001
From: TKHR-Shiu
Date: Fri, 8 May 2026 18:53:38 +0900
Subject: [PATCH 5/6] =?UTF-8?q?=E3=83=9B=E3=83=BC=E3=83=A0=E7=94=BB?=
=?UTF-8?q?=E9=9D=A2=E3=81=AE=E3=82=A2=E3=82=A4=E3=82=B9=E3=82=AF=E3=83=AA?=
=?UTF-8?q?=E3=83=BC=E3=83=A0=E3=81=AE=E4=BD=8D=E7=BD=AE=E5=A4=89=E6=9B=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/routes/home.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/routes/home.tsx b/app/routes/home.tsx
index 86ba063..d802349 100644
--- a/app/routes/home.tsx
+++ b/app/routes/home.tsx
@@ -49,11 +49,11 @@ function renderIceCream(spec: IceCreamSpec, index: number) {
}
const iceCreams : IceCreamSpec[] = [
- { x: "24px", y: "calc(100% - 100px)", cone: "red", scoops: ["vanilla", "chocolate", "chocolate","strawberry", "strawberry"] },
+ { x: "10%", y: "calc(100% - 100px)", cone: "red", scoops: ["vanilla", "chocolate", "chocolate","strawberry", "strawberry"] },
{ x: "25%", y: "calc(100% - 100px)", cone: "brown", scoops: ["strawberry", "vanilla", "chocolate"] },
{ x: "50%", y: "calc(100% - 100px)", cone: "yellow", scoops: ["chocolate"] },
{ x: "75%", y: "calc(100% - 100px)", cone: "red", scoops: ["chocolate", "strawberry", "vanilla"] },
- { x: "calc(100% - 100px)", y: "calc(100% - 100px)", cone: "brown", scoops: ["strawberry", "strawberry", "chocolate", "vanilla", "strawberry"] },
+ { x: "90%", y: "calc(100% - 100px)", cone: "brown", scoops: ["strawberry", "strawberry", "chocolate", "vanilla", "strawberry"] },
];
export function meta({}: Route.MetaArgs) {
From 10b3aeb78b61dd3c545eed2ea0c541d6d4b13b92 Mon Sep 17 00:00:00 2001
From: TKHR-Shiu
Date: Fri, 8 May 2026 18:54:57 +0900
Subject: [PATCH 6/6] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=95=E3=83=AA?=
=?UTF-8?q?=E3=82=AF=E3=83=88=E5=AF=BE=E5=BF=9C2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/lib/icemake.ts | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/lib/icemake.ts b/app/lib/icemake.ts
index b32434b..38b4bbe 100644
--- a/app/lib/icemake.ts
+++ b/app/lib/icemake.ts
@@ -115,8 +115,7 @@ function runGraphExecution(
let condition = false;
// ifノードの条件を、色 / 部分配列一致 / 個数で評価する
if (component.type === "if") {
- const cond: ConeColor | Flavor[] | number =
- component.condition;
+ const cond: ConeColor | Flavor[] | number = component.condition;
if (typeof cond === "string") {
condition = color === cond;
} else if (Array.isArray(cond)) {