위협 가이드 제거: 오목 위험 자리, 체스·장기 위험 기물 경고, 바둑 단수 경고
- 오목: 상대 3·4를 막으라는 빨간 동그라미·노란 점선(hints 옵션, view.hints, threatHints) 삭제 - 체스·장기: hints 'movesAndThreats'(주황 점선 위험 기물) 삭제 → 'off' / 'moves'만 남김 - 바둑: atariWarning 옵션과 atariWarnings(깜빡이는 단수 돌) 삭제 - 도움말 문구·설정 화면·docs 정리, 테스트는 "어떤 view에도 위협 표시 없음"으로 바꿈 - 갈 수 있는 칸 점, 금수 ×, 둘 수 없는 점 같은 규칙 표시는 그대로 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -531,7 +531,7 @@ describe('undo, draw, resign', () => {
|
||||
});
|
||||
|
||||
describe('views and determinism', () => {
|
||||
test('no hidden internals in any view; mover-only hints', () => {
|
||||
test('no hidden internals in any view; mover-only illegal points; no atari warning', () => {
|
||||
let s = make({}, { black: ['B1', 'A2'], white: ['A3', 'C1'] }, 'white');
|
||||
s = play(s, 'B2'); // black B1/A2... put black stones in atari
|
||||
for (const viewer of ['A', 'B', null]) {
|
||||
@@ -541,14 +541,9 @@ describe('views and determinism', () => {
|
||||
expect(json).not.toContain('rng');
|
||||
}
|
||||
const mover = baduk.view(s, 'A');
|
||||
expect(mover.atariWarnings.length).toBeGreaterThan(0);
|
||||
expect(mover.illegalPoints.length).toBeGreaterThan(0);
|
||||
for (const viewer of ['B', null]) {
|
||||
const v = baduk.view(s, viewer);
|
||||
expect(v.illegalPoints).toEqual([]);
|
||||
expect(v.atariWarnings).toEqual([]);
|
||||
}
|
||||
expect(baduk.view(make({ atariWarning: false }, { black: ['B1'], white: ['A1', 'C1'] }), 'A').atariWarnings).toEqual([]);
|
||||
for (const viewer of ['B', null]) expect(baduk.view(s, viewer).illegalPoints).toEqual([]);
|
||||
for (const viewer of ['A', 'B', null]) expect(JSON.stringify(baduk.view(s, viewer))).not.toMatch(/atari/i);
|
||||
});
|
||||
|
||||
test('nigiri is seeded and deterministic', () => {
|
||||
|
||||
@@ -238,12 +238,6 @@ export function illegalPoints(
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Stones of colour c that are in atari (chains with exactly one liberty). */
|
||||
export function atariStones(board: readonly Cell[], size: number, c: Stone): number[] {
|
||||
const { chains } = mapChains(board, size);
|
||||
return chains.filter((ch) => ch.color === c && ch.libs.length === 1).flatMap((ch) => ch.stones);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------ scoring
|
||||
|
||||
export interface Regions {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { z } from 'zod';
|
||||
import { fail, ok, type GameDefinition, type GameEvent, type GameResult, type PlayerId } from '@bg/engine';
|
||||
import {
|
||||
atariStones,
|
||||
chainAt,
|
||||
emptyRegionAt,
|
||||
hashBoard,
|
||||
@@ -79,7 +78,6 @@ export const badukOptionsSchema = z
|
||||
.meta({ title: '무르기(1인당, 상대 동의)', labels: { off: '안 씀', 1: '1번', 3: '3번', unlimited: '무제한' } }),
|
||||
drawOffer: z.boolean().default(true).meta({ title: '무승부 제안 허용' }),
|
||||
drawReofferMoves: z.number().int().min(0).max(50).default(5).meta({ title: '무승부 다시 제안까지 둬야 하는 수' }),
|
||||
atariWarning: z.boolean().default(true).meta({ title: '단수 경고(내 돌이 단수에 몰리면 표시)' }),
|
||||
scoringDeadlineSec: z
|
||||
.union([z.literal(120), z.literal(180), z.literal(300)])
|
||||
.default(180)
|
||||
@@ -176,7 +174,7 @@ export interface BadukView {
|
||||
myColor: Color | null;
|
||||
turn: Color;
|
||||
phase: BadukState['phase'];
|
||||
rules: { scoring: BadukOptions['scoring']; koRule: BadukOptions['koRule']; komi: number; handicap: number; atariWarning: boolean };
|
||||
rules: { scoring: BadukOptions['scoring']; koRule: BadukOptions['koRule']; komi: number; handicap: number };
|
||||
captures: Record<Color, number>;
|
||||
moveCount: number;
|
||||
moves: { color: Color; pt: Pt | null; captured: number }[];
|
||||
@@ -200,8 +198,6 @@ export interface BadukView {
|
||||
draw: { allowed: boolean; pendingBy: Color | null };
|
||||
/** Only for the player to move. */
|
||||
illegalPoints: (Pt & { reason: IllegalReason })[];
|
||||
/** Only for the player to move (atariWarning option): own stones in atari. */
|
||||
atariWarnings: Pt[];
|
||||
scoring: {
|
||||
dead: Pt[];
|
||||
/** Every point of seki-marked regions. */
|
||||
@@ -758,7 +754,7 @@ export const baduk: GameDefinition<BadukState, BadukAction, BadukView, BadukOpti
|
||||
myColor,
|
||||
turn: s.turn,
|
||||
phase: s.phase,
|
||||
rules: { scoring: s.options.scoring, koRule: s.options.koRule, komi: s.komi, handicap: s.handicap, atariWarning: s.options.atariWarning },
|
||||
rules: { scoring: s.options.scoring, koRule: s.options.koRule, komi: s.komi, handicap: s.handicap },
|
||||
captures: s.captures,
|
||||
moveCount: s.moves.length,
|
||||
moves: s.moves.map((mv) => ({ color: mv.color, pt: mv.kind === 'place' ? mv.pt : null, captured: mv.kind === 'place' ? mv.captured.length : 0 })),
|
||||
@@ -787,7 +783,6 @@ export const baduk: GameDefinition<BadukState, BadukAction, BadukView, BadukOpti
|
||||
},
|
||||
draw: { allowed: s.options.drawOffer, pendingBy: s.draw.pendingBy },
|
||||
illegalPoints: myTurn ? [...illegalMap(s)].map(([i, reason]) => ({ ...toPt(i, s.size), reason })) : [],
|
||||
atariWarnings: myTurn && s.options.atariWarning ? atariStones(s.board, s.size, STONE[myColor]).map((i) => toPt(i, s.size)) : [],
|
||||
scoring: m
|
||||
? {
|
||||
dead: m.dead.map((i) => toPt(i, s.size)),
|
||||
|
||||
Reference in New Issue
Block a user