Something went wrong. Try again.
A video game where you play as a misaligned AI, deceiving and building power. An experiment in spec-driven development. cameron.tngl.io/misaligned
Something went wrong. Try again.
822 B · 16 lines
TypeScript
at main
1234567891011121314151617// Balance, from CLAUDE.md: rushing should mostly lose, careful play should mostly win.// Seeded, so a change in the result means the rules changed, not the dice.import { test } from 'node:test';import assert from 'node:assert/strict';import { playGame } from '../scripts/play.ts';
const games = (careful: boolean, n: number) => Array.from({ length: n }, (_, i) => playGame(careful, 1000 + i));
test('rushing mostly loses', () => { const rs = games(false, 10), wins = rs.filter(r => r.outcome === 'WIN').length; assert.ok(wins <= 2, `rush won ${wins}/10:\n${rs.map(r => r.line).join('\n')}`);});test('careful play mostly wins', () => { const rs = games(true, 6), wins = rs.filter(r => r.outcome === 'WIN').length; assert.ok(wins >= 5, `careful won only ${wins}/6:\n${rs.map(r => r.line).join('\n')}`);});