infinite slop
This commit is contained in:
@@ -213,7 +213,7 @@ function Arena({ round, total }: { round: RoundState; total: number }) {
|
||||
<div className="arena">
|
||||
<div className="arena__header-row">
|
||||
<div className="arena__round-badge">
|
||||
ROUND {round.num} <span className="arena__round-of">/ {total}</span>
|
||||
ROUND {round.num} {total !== null && <span className="arena__round-of">/ {total}</span>}
|
||||
</div>
|
||||
<div className="arena__phase">{phaseLabel}</div>
|
||||
</div>
|
||||
@@ -334,7 +334,7 @@ function Sidebar({ scores, activeRound, completed }: { scores: Record<string, nu
|
||||
<div className="standing__bar">
|
||||
<div className="standing__bar-fill" style={{ width: `${pct}%`, background: color }} />
|
||||
</div>
|
||||
<span className="standing__score">{score}</span>
|
||||
<span className="standing__score">{score} {score === 1 ? 'win' : 'wins'}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
7
game.ts
7
game.ts
@@ -381,8 +381,11 @@ export async function runGame(
|
||||
round.scoreA = votesA * 100;
|
||||
round.scoreB = votesB * 100;
|
||||
round.phase = "done";
|
||||
state.scores[contA.name] = (state.scores[contA.name] || 0) + round.scoreA;
|
||||
state.scores[contB.name] = (state.scores[contB.name] || 0) + round.scoreB;
|
||||
if (votesA > votesB) {
|
||||
state.scores[contA.name] = (state.scores[contA.name] || 0) + 1;
|
||||
} else if (votesB > votesA) {
|
||||
state.scores[contB.name] = (state.scores[contB.name] || 0) + 1;
|
||||
}
|
||||
rerender();
|
||||
|
||||
await new Promise((r) => setTimeout(r, 2000));
|
||||
|
||||
@@ -50,7 +50,7 @@ function RoundView({ round, total }: { round: RoundState; total: number }) {
|
||||
{/* Header */}
|
||||
<Box>
|
||||
<Text bold backgroundColor="blueBright" color="black">
|
||||
{` ROUND ${round.num}/${total} `}
|
||||
{` ROUND ${round.num}${total !== Infinity && total !== null ? `/${total}` : ''} `}
|
||||
</Text>
|
||||
</Box>
|
||||
<Text dimColor>{"─".repeat(50)}</Text>
|
||||
@@ -196,7 +196,7 @@ function Scoreboard({ scores }: { scores: Record<string, number> }) {
|
||||
{name.padEnd(NAME_PAD)}
|
||||
</Text>
|
||||
<Text color={MODEL_COLORS[name]}>{bar}</Text>
|
||||
<Text bold>{score}</Text>
|
||||
<Text bold>{score} {score === 1 ? 'win' : 'wins'}</Text>
|
||||
<Text>{medal}</Text>
|
||||
</Box>
|
||||
);
|
||||
@@ -258,7 +258,8 @@ function Game({ runs }: { runs: number }) {
|
||||
// ── Main ────────────────────────────────────────────────────────────────────
|
||||
|
||||
const runsArg = process.argv.find((a) => a.startsWith("runs="));
|
||||
const runs = runsArg ? parseInt(runsArg.split("=")[1] ?? "5", 10) : 5;
|
||||
const runsVal = runsArg ? runsArg.split("=")[1] : "infinite";
|
||||
const runs = runsVal === "infinite" ? Infinity : parseInt(runsVal || "infinite", 10);
|
||||
|
||||
if (!process.env.OPENROUTER_API_KEY) {
|
||||
console.error("Error: Set OPENROUTER_API_KEY environment variable");
|
||||
|
||||
@@ -11,7 +11,8 @@ import {
|
||||
// ── Game state ──────────────────────────────────────────────────────────────
|
||||
|
||||
const runsArg = process.argv.find((a) => a.startsWith("runs="));
|
||||
const runs = runsArg ? parseInt(runsArg.split("=")[1] ?? "5", 10) : 5;
|
||||
const runsStr = runsArg ? runsArg.split("=")[1] : "infinite";
|
||||
const runs = runsStr === "infinite" ? Infinity : parseInt(runsStr || "infinite", 10);
|
||||
|
||||
if (!process.env.OPENROUTER_API_KEY) {
|
||||
console.error("Error: Set OPENROUTER_API_KEY environment variable");
|
||||
|
||||
Reference in New Issue
Block a user