컴퓨터 생각 시간을 사람처럼: 컴퓨터마다 다른 빠르기, 고를 게 많을수록 길게, 가끔 멈칫
- defaultBotDelay: 할 게 하나면 0.7~1.3초, 고르면 1.6~3.9초(+12% 확률로 1~3초 멈칫) - botPace: 컴퓨터 id로 고정된 0.7~1.5배 빠르기 - 같은 컴퓨터가 이어서 두는 동작은 절반, 사람과 같은 반응 창은 +1.5초(그대로) - 차례 시간이 있으면 남은 시간의 절반을 넘기지 않음 - e2e(bots) 컴퓨터 응답 대기 8초 → 15초, docs/06 §12 갱신 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -92,13 +92,13 @@ try {
|
||||
// Three answers at most: even moving first the computer has only four stones, so the game is still running for
|
||||
// the steps below.
|
||||
for (let turn = 0; turn < 8 && answers < 3; turn++) {
|
||||
await a.waitForFunction(() => /내 차례예요|게임이 끝|이겼|졌/.test(document.querySelector('.turn-status')?.textContent ?? ''), null, { timeout: 8000 });
|
||||
await a.waitForFunction(() => /내 차례예요|게임이 끝|이겼|졌/.test(document.querySelector('.turn-status')?.textContent ?? ''), null, { timeout: 15000 });
|
||||
if (await resultShown(a)) break;
|
||||
const before = await stones(a);
|
||||
const cell = order.find((i) => !before.has(i) && (i % 15) % 2 === turn % 2)!;
|
||||
await clickCell(a, cell % 15, Math.floor(cell / 15));
|
||||
// Our stone, then the computer's answer (it thinks ~1 s).
|
||||
await a.waitForFunction((n) => document.querySelectorAll('svg[role="grid"] g:not([opacity="0.55"]) > circle[r="0.46"]').length >= n + 2 || !!document.querySelector('[role="dialog"]'), before.size, { timeout: 8000 });
|
||||
await a.waitForFunction((n) => document.querySelectorAll('svg[role="grid"] g:not([opacity="0.55"]) > circle[r="0.46"]').length >= n + 2 || !!document.querySelector('[role="dialog"]'), before.size, { timeout: 15000 });
|
||||
if (await resultShown(a)) break;
|
||||
answers++;
|
||||
if (answers === 2) await a.screenshot({ path: join(SHOTS, 'bots-2-omok-pc.png') });
|
||||
|
||||
Reference in New Issue
Block a user