From 7084a20e5952d62fca3fe11aea877093b739d9ba Mon Sep 17 00:00:00 2001 From: EJClaw Date: Sun, 8 Nov 2026 02:21:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9C=B7=EB=86=80=EC=9D=B4:=20=EB=AA=A8?= =?UTF-8?q?=EC=84=9C=EB=A6=AC=20=EC=9D=B4=EB=A6=84=EC=9D=84=20=EC=88=AB?= =?UTF-8?q?=EC=9E=90=EB=A1=9C(1=EB=B2=88=20=EC=B6=9C=EB=B0=9C=20=E2=86=92?= =?UTF-8?q?=202=EB=B2=88=20=E2=86=92=203=EB=B2=88=20=E2=86=92=204=EB=B2=88?= =?UTF-8?q?),=20=EC=B9=B8=20=EC=9D=B4=EB=A6=84=EB=8F=84=20'N=EB=B2=88=20?= =?UTF-8?q?=EB=8B=A4=EC=9D=8C=20k=EC=B9=B8'=C2=B7'N=EB=B2=88=20=EC=A7=80?= =?UTF-8?q?=EB=A6=84=EA=B8=B8=20k=EC=B9=B8'=EC=9C=BC=EB=A1=9C=20=EC=89=BD?= =?UTF-8?q?=EA=B2=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- apps/web/src/games/yut/aug-ui.tsx | 7 ++-- apps/web/src/games/yut/help.test.ts | 6 +-- apps/web/src/games/yut/help.ts | 2 +- apps/web/src/games/yut/house-rules.ts | 14 +++---- apps/web/src/games/yut/index.tsx | 58 ++++++++++++++------------- apps/web/src/games/yut/quick.tsx | 4 +- docs/games/yut.md | 4 ++ packages/games/src/yut/aug.ts | 6 +-- packages/games/src/yut/augments.ts | 16 ++++---- packages/games/src/yut/board.ts | 14 +++++-- packages/games/src/yut/index.ts | 8 ++-- 11 files changed, 77 insertions(+), 62 deletions(-) diff --git a/apps/web/src/games/yut/aug-ui.tsx b/apps/web/src/games/yut/aug-ui.tsx index ad66acc..cf7bd5d 100644 --- a/apps/web/src/games/yut/aug-ui.tsx +++ b/apps/web/src/games/yut/aug-ui.tsx @@ -6,7 +6,7 @@ import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState, type Focu import { createPortal } from 'react-dom'; import type { AugFx, AugUseOption, PieceKind, YutAugView, YutView } from '@bg/games/yut'; import { AUGS, KIND_KO, TIER_KO, type AugId } from '@bg/games/yut/augments'; -import { NODE_POS } from '@bg/games/yut/board'; +import { NODE_NAMES, NODE_POS } from '@bg/games/yut/board'; import type { PublicUser } from '@bg/shared/lite'; import { Sheet } from '../../components/ui'; import { haptic, sounds } from '../../lib/feedback'; @@ -683,8 +683,7 @@ function ManyTargets({ opts, pending, onUse }: { opts: AugUseOption[]; pending: ); } -const NODE_KO = ['참먹이', '도', '개', '걸', '윷', '모', '뒷도', '뒷개', '뒷걸', '뒷윷', '뒷모', '찌도', '찌개', '찌걸', '찌윷', '찌모', '날도', '날개', '날걸', '날윷', '앞모도', '앞모개', '방', '속윷', '속모', '뒷모도', '뒷모개', '사려', '안찌']; -const nodeKo = (n: number | 'home' | 'goal') => (n === 'home' ? '대기' : n === 'goal' ? '남' : (NODE_KO[n] ?? String(n))); +const nodeKo = (n: number | 'home' | 'goal') => (n === 'home' ? '대기' : n === 'goal' ? '남' : (NODE_NAMES[n] ?? String(n))); // ---------------------------------------------------------------- board layers (inside the board ) @@ -698,7 +697,7 @@ export function BoardObjects({ v }: { v: YutView }) { {v.aug!.objs.map((o, i) => { const [x, y] = NODE_POS[o.node]!; return ( - + = 0 ? COLORS[o.owner] : 'var(--wood-line)'} strokeWidth={0.6} opacity={0.95} /> {OBJ_ICON[o.kind]} diff --git a/apps/web/src/games/yut/help.test.ts b/apps/web/src/games/yut/help.test.ts index e56d3e1..8b9c3fc 100644 --- a/apps/web/src/games/yut/help.test.ts +++ b/apps/web/src/games/yut/help.test.ts @@ -74,11 +74,11 @@ function freshWith(opts: Record) { test('윷 지역 룰: 기본 방의 요약은 그대로이고, 바꾼 규칙만 요약에 붙어요', () => { const d = GAMES.yut!.defaultOptions as any; - expect(optionsSummary(d)).toBe('개인전 · 말 4개 · 빽도 있음 · 참먹이 지나야 남 · 30초'); + expect(optionsSummary(d)).toBe('개인전 · 말 4개 · 빽도 있음 · 1번(출발) 지나야 남 · 30초'); expect(changedTags(d)).toEqual([]); expect(houseRules(d).every((r) => !r.changed)).toBe(true); const o = GAMES.yut!.optionsSchema.parse({ stacking: 'choose', forkRule: 'choose', useOrder: 'thrown', backdoNoPiece: 'rethrow', nakPercent: 5, nakRule: 'lose' }) as any; - expect(optionsSummary(o)).toBe('개인전 · 말 4개 · 빽도 있음 · 참먹이 지나야 남 · 낙 5% · 말 없을 때 빽도는 다시 던짐 · 업기 고르기 · 갈림길 고르기 · 던진 순서대로 쓰기 · 낙이면 차례 끝 · 30초'); + expect(optionsSummary(o)).toBe('개인전 · 말 4개 · 빽도 있음 · 1번(출발) 지나야 남 · 낙 5% · 말 없을 때 빽도는 다시 던짐 · 업기 고르기 · 갈림길 고르기 · 던진 순서대로 쓰기 · 낙이면 차례 끝 · 30초'); // Rules that cannot matter are not listed: no 빽도 → no 빽도 rules, no 낙 → no 낙 handling, 팀전 → no ranking. const keys = houseRules(GAMES.yut!.optionsSchema.parse({ backdo: false, mode: 'team' }) as any).map((r) => r.key); expect(keys).not.toContain('backdoNoPiece'); @@ -111,5 +111,5 @@ test('윷 지역 룰: 빽도 다시 던지기 / 던진 순서대로 / 갈 길· const e = freshWith({ backdoNoPiece: 'enter' }); const w = applyAction('yut', e.state, e.me, { type: 'THROW' }, { next: (() => { const q = [...BK.backdo]; return () => q.shift()!; })() } as any); - expect(helpNow(view(w, e.me), e.me, users)).toContain('빽도로 새 말을 참먹이 한 칸 뒤(날윷)에 올릴 수 있어요'); + expect(helpNow(view(w, e.me), e.me, users)).toContain('빽도로 새 말을 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올릴 수 있어요'); }); diff --git a/apps/web/src/games/yut/help.ts b/apps/web/src/games/yut/help.ts index 9c162f9..671fd0f 100644 --- a/apps/web/src/games/yut/help.ts +++ b/apps/web/src/games/yut/help.ts @@ -75,7 +75,7 @@ export function helpNow(v: YutView, me: string | null, players: Record !usable.has(t))) lines.push('지금 쓸 곳이 없는 결과는 눌리지 않아요. 다른 결과를 먼저 써 보세요.'); if (moves.some((m) => m.alt)) lines.push('모서리나 방에 멈췄던 말은 [갈 길 고르기]에서 지름길과 다른 길 중에 고를 수 있어요.'); if (moves.some((m) => m.stack === false)) lines.push('내 말이 있는 자리에 멈출 때 [따로 두기]를 고르면 업지 않고 옆에 둬요.'); - if (moves.some((m) => m.throw === 'backdo' && m.from === 'home')) lines.push('판에 내 말이 없어서 빽도로 새 말을 참먹이 한 칸 뒤(날윷)에 올릴 수 있어요.'); + if (moves.some((m) => m.throw === 'backdo' && m.from === 'home')) lines.push('판에 내 말이 없어서 빽도로 새 말을 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올릴 수 있어요.'); const tips: string[] = []; if (moves.some((m) => m.captures > 0)) { const bonus = moves.some((m) => m.captures > 0 && (m.throw !== 'backdo' || v.options.backdoCaptureBonus)); diff --git a/apps/web/src/games/yut/house-rules.ts b/apps/web/src/games/yut/house-rules.ts index c3985a7..cc2b11c 100644 --- a/apps/web/src/games/yut/house-rules.ts +++ b/apps/web/src/games/yut/house-rules.ts @@ -29,11 +29,11 @@ export function houseRules(o: YutOptions): HouseRule[] { 'backdoNoPiece', '판에 내 말이 없을 때 빽도', np !== 'discard', - np === 'rethrow' ? '말 없을 때 빽도는 다시 던짐' : '말 없을 때 빽도는 날윷으로', + np === 'rethrow' ? '말 없을 때 빽도는 다시 던짐' : '말 없을 때 빽도는 1번(출발) 앞 칸으로', np === 'rethrow' ? '판에 내 말이 없을 때 나온 빽도는 없던 걸로 하고 다시 던져요.' : np === 'enter' - ? `판에 내 말이 없을 때 빽도가 나오면 새 말이 참먹이 한 칸 뒤(날윷)에 올라가요. ${reach ? '다음에 앞으로 가면 바로 나요.' : '다음에 도면 참먹이에 서고, 개 이상이면 바로 나요.'}` + ? `판에 내 말이 없을 때 빽도가 나오면 새 말이 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올라가요. ${reach ? '다음에 앞으로 가면 바로 나요.' : '다음에 도면 1번에 서고, 개 이상이면 바로 나요.'}` : '판에 내 말이 없으면 빽도는 쓸 곳이 없어서 버려요.', ); add( @@ -41,7 +41,7 @@ export function houseRules(o: YutOptions): HouseRule[] { '도 자리에서 빽도', o.backdoFromDo === 'finish', '도 자리 빽도는 바로 남', - o.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 그 자리에서 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 참먹이로 가고, 다음에 앞으로 가면 바로 나요.', + o.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 그 자리에서 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 1번(출발)으로 가고, 다음에 앞으로 가면 바로 나요.', ); add('backdoCaptureBonus', '빽도로 잡았을 때', !o.backdoCaptureBonus, '빽도로 잡으면 더 안 던짐', o.backdoCaptureBonus ? '빽도로 잡아도 한 번 더 던져요.' : '빽도로 잡을 때는 한 번 더 던지지 않아요.'); } @@ -62,8 +62,8 @@ export function houseRules(o: YutOptions): HouseRule[] { fork, '갈림길 고르기', fork - ? '모서리(모·뒷모)나 방에 멈췄다가 출발할 때 지름길로 갈지 다른 길로 갈지 골라요. 지나가기만 할 때는 그대로 직진해요.' - : '모서리(모·뒷모)나 방에 멈췄다가 출발하면 늘 안쪽 지름길로 가요. 방에서는 참먹이 쪽으로 가요.', + ? '2번·3번 모서리나 방에 멈췄다가 출발할 때 지름길로 갈지 다른 길로 갈지 골라요. 지나가기만 할 때는 그대로 직진해요.' + : '2번·3번 모서리나 방에 멈췄다가 출발하면 늘 안쪽 지름길로 가요. 방에서는 1번(출발) 쪽으로 가요.', ); const ordered = o.useOrder === 'thrown'; add( @@ -73,7 +73,7 @@ export function houseRules(o: YutOptions): HouseRule[] { '던진 순서대로 쓰기', ordered ? '모아 둔 결과는 던진 순서대로 써요. 맨 앞 결과를 쓸 곳이 없으면 그 결과만 버려요.' : '모아 둔 결과는 원하는 순서로 써요.', ); - add('finishRule', '날(완주)', reach, '참먹이 도착하면 남', reach ? '한 바퀴 돈 말이 참먹이에 도착하면 바로 나요.' : '한 바퀴 돈 말이 참먹이를 지나가야 나요. 참먹이에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.'); + add('finishRule', '날(완주)', reach, '1번(출발) 도착하면 남', reach ? '한 바퀴 돈 말이 1번(출발)에 도착하면 바로 나요.' : '한 바퀴 돈 말이 1번(출발)을 지나가야 나요. 1번에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.'); add('nakPercent', '낙', o.nakPercent > 0, `낙 ${o.nakPercent}%`, o.nakPercent > 0 ? `윷가락이 ${o.nakPercent}% 확률로 판 밖으로 떨어져요(낙).` : '낙 없이 해요.'); if (o.nakPercent > 0) { const lose = o.nakRule === 'lose'; @@ -102,7 +102,7 @@ export function optionsSummary(o: YutOptions): string { o.mode === 'team' ? '팀전' : '개인전', `말 ${o.pieces}개`, o.backdo ? '빽도 있음' : '빽도 없음', - o.finishRule === 'pass' ? '참먹이 지나야 남' : '참먹이 도착하면 남', + o.finishRule === 'pass' ? '1번(출발) 지나야 남' : '1번(출발) 도착하면 남', ...(o.nakPercent ? [`낙 ${o.nakPercent}%`] : []), ...changedTags(o), o.turnSeconds === null ? '시간 무제한' : `${o.turnSeconds}초`, diff --git a/apps/web/src/games/yut/index.tsx b/apps/web/src/games/yut/index.tsx index 63f4461..d2dc87e 100644 --- a/apps/web/src/games/yut/index.tsx +++ b/apps/web/src/games/yut/index.tsx @@ -8,6 +8,7 @@ import { haptic, sounds } from '../../lib/feedback'; import type { BoardProps, GameUI, OptionsProps } from '../types'; import { AugOptions } from './aug-options'; import { AUGS, AUG_IDS, type AugId } from '@bg/games/yut/augments'; +import { NODE_NAMES } from '@bg/games/yut/board'; import { AUG_CSS, AugFxLayer, @@ -47,22 +48,19 @@ const toAction = (m: YutLegalMove) => ({ ...(m.stack === false ? { stack: false } : {}), }); /** Road names at a fork: the ordinary road first. */ -const roadNames = (from: From): [string, string] => (from === 22 ? ['참먹이 쪽', '찌모 쪽'] : ['지름길', '바깥 길']); +const roadNames = (from: From): [string, string] => (from === 22 ? ['1번(출발) 쪽', '4번 쪽'] : ['지름길', '바깥 길']); type GameEvent = YutView['log'][number]; -// The rules module is imported for types only (no zod in this chunk); these small tables mirror packages/games/src/yut/board.ts. -const NODE_NAMES = [ - '참먹이', '도', '개', '걸', '윷', '모', '뒷도', '뒷개', '뒷걸', '뒷윷', - '뒷모', '찌도', '찌개', '찌걸', '찌윷', '찌모', '날도', '날개', '날걸', '날윷', - '앞모도', '앞모개', '방', '속윷', '속모', '뒷모도', '뒷모개', '사려', '안찌', -]; +// The rules module is imported for types only (no zod in this chunk); these small tables mirror packages/games/src/yut/board.ts +// (board.ts itself has no runtime imports, so NODE_NAMES comes straight from there). const THROW_KO: Record = { do: '도', gae: '개', geol: '걸', yut: '윷', mo: '모', backdo: '빽도' }; const STEPS: Record = { do: 1, gae: 2, geol: 3, yut: 4, mo: 5, backdo: -1 }; const stepText = (t: Throw) => (t === 'backdo' ? '뒤로 1칸' : `${STEPS[t]}칸`); const BIG = new Set([0, 5, 10, 15, 22]); -const BIG_LABELS: [number, string][] = [[0, '출발'], [5, '모'], [10, '뒷모'], [15, '찌모'], [22, '방']]; +/** Corner numbers in the moving direction (2026-11-08: plain numbers instead of 참먹이·모·뒷모·찌모), 1 also says 출발. */ +const BIG_LABELS: [number, string][] = [[0, '1'], [5, '2'], [10, '3'], [15, '4'], [22, '방']]; -// Board geometry (viewBox 0..100): 참먹이 bottom-right, 모 top-right, 뒷모 top-left, 찌모 bottom-left; pieces go anticlockwise. +// Board geometry (viewBox 0..100): 1번(출발) bottom-right, 2번 top-right, 3번 top-left, 4번 bottom-left; pieces go anticlockwise. const LO = 8; const HI = 92; const GAP = (HI - LO) / 5; @@ -82,7 +80,7 @@ const POS: [number, number][] = (() => { [27, 28].forEach((n, k) => (p[n] = lerp(p[10]!, p[0]!, (k + 4) / 6))); return p; })(); -/** Where pieces come from / go to (just outside 참먹이). */ +/** Where pieces come from / go to (just outside 1번(출발)). */ const HOME_PT: [number, number] = [HI + 4, HI + 7]; const LINES: [number, number][] = [ ...Array.from({ length: 20 }, (_, i) => [i, (i + 1) % 20] as [number, number]), @@ -451,7 +449,7 @@ function YutBoard({ view: v, me, players, act, pending, deadline }: BoardProps{AUG_CSS}}
{aug && } - + {LINES.map(([a, b]) => ( @@ -466,10 +464,13 @@ function YutBoard({ view: v, me, players, act, pending, deadline }: BoardProps ))} {BIG_LABELS.map(([n, t]) => ( - + {t} ))} + + 출발 + {/* direction hint at the start */} {aug && } @@ -1004,12 +1005,12 @@ function Options({ value: o, onChange }: OptionsProps) { set({ backdoNoPiece })} /> - set({ backdoFromDo })} /> + set({ backdoFromDo })} /> set({ backdoCaptureBonus: k === 'on' })} /> @@ -1028,7 +1029,7 @@ function Options({ value: o, onChange }: OptionsProps) { set({ useOrder })} /> - set({ finishRule })} /> + set({ finishRule })} /> @@ -1118,16 +1119,19 @@ function MiniBoard() { ))} {[ - [0, '출발'], - [5, '모'], - [10, '뒷모'], - [15, '찌모'], + [0, '1'], + [5, '2'], + [10, '3'], + [15, '4'], [22, '방'], ].map(([n, t]) => ( - + {t} ))} + + 출발 + ); } @@ -1201,7 +1205,7 @@ function Rules({ options }: { options?: YutOptions }) {
{o?.augmented && }

- 윷가락 네 개를 던져 나온 만큼 말을 움직여, 내 말을 모두 먼저 판 밖으로 내보내면(날) 이겨요. 말은 오른쪽 아래 참먹이에서 출발해 시계 반대 방향으로 돌아요. + 윷가락 네 개를 던져 나온 만큼 말을 움직여, 내 말을 모두 먼저 판 밖으로 내보내면(날) 이겨요. 말은 오른쪽 아래 1번(출발)에서 출발해 시계 반대 방향으로 2번 → 3번 → 4번 모서리를 돌아 1번으로 돌아와요. {o?.mode === 'team' ? ' 팀전은 청팀·홍팀이 번갈아 던지고, 팀 안에서는 자리 순서대로 돌아가요.' : ''}

@@ -1218,17 +1222,17 @@ function Rules({ options }: { options?: YutOptions }) {

- 지름길: 모서리(모·뒷모)나 가운데 방에 멈췄다가 다음에 출발하면 안쪽 대각선으로 꺾어요. 지나가기만 하면 그대로 직진해요.{' '} + 지름길: 2번·3번 모서리나 가운데 방에 멈췄다가 다음에 출발하면 안쪽 대각선으로 꺾어요. 지나가기만 하면 그대로 직진해요.{' '} {o?.forkRule === 'choose' - ? '이 방은 갈 길을 고르는 규칙이라, 멈췄던 말을 움직일 때 지름길과 다른 길 중에서 골라요(방에서는 참먹이 쪽과 찌모 쪽).' - : '방에서 출발하면 언제나 참먹이 쪽으로 가요.'} + ? '이 방은 갈 길을 고르는 규칙이라, 멈췄던 말을 움직일 때 지름길과 다른 길 중에서 골라요(방에서는 1번 쪽과 4번 쪽).' + : '방에서 출발하면 언제나 1번(출발) 쪽으로 가요.'}

업기: 내 말이 있는 자리에 멈추면 {o?.stacking === 'choose' ? '업어서 같이 움직일지, 따로 둘지 골라요(따로 둬도 잡힐 때는 함께 잡혀요)' : '함께 업혀서 같이 움직여요'}. 잡기: 상대 말이 있는 자리에 멈추면 그 말들을 처음으로 돌려보내고 한 번 더 던져요 {o && !o.backdoCaptureBonus ? '(빽도로 잡을 때는 빼고)' : ''}. 지나가기만 해서는 잡지 않아요.

- 날: {o?.finishRule === 'reach' ? '한 바퀴 돈 말이 참먹이에 도착하면 바로 나요.' : '한 바퀴 돈 말이 참먹이를 지나가야 나요. 참먹이에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.'} + 날: {o?.finishRule === 'reach' ? '한 바퀴 돈 말이 1번(출발)에 도착하면 바로 나요.' : '한 바퀴 돈 말이 1번(출발)을 지나가야 나요. 1번에 딱 멈추면 아직 판 위라서 잡힐 수 있어요.'}

{o?.backdo !== false && (

@@ -1236,9 +1240,9 @@ function Rules({ options }: { options?: YutOptions }) { {o?.backdoNoPiece === 'rethrow' ? '판 위에 내 말이 없을 때 나온 빽도는 없던 걸로 하고 다시 던져요.' : o?.backdoNoPiece === 'enter' - ? '판 위에 내 말이 없을 때 빽도가 나오면 새 말이 참먹이 한 칸 뒤(날윷)에 올라가요.' + ? '판 위에 내 말이 없을 때 빽도가 나오면 새 말이 1번(출발) 바로 앞 칸(4번 다음 4칸)에 올라가요.' : '판 위에 말이 없으면 빽도는 버려져요.'}{' '} - {o?.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 참먹이로 가고, 다음 전진에서 바로 나요.'} + {o?.backdoFromDo === 'finish' ? '도 자리에 있는 말이 빽도를 받으면 바로 나요.' : '도 자리에 있는 말이 빽도를 받으면 1번(출발)으로 가고, 다음 전진에서 바로 나요.'}

)} {!!o?.nakPercent && ( diff --git a/apps/web/src/games/yut/quick.tsx b/apps/web/src/games/yut/quick.tsx index 451b20e..24b9af4 100644 --- a/apps/web/src/games/yut/quick.tsx +++ b/apps/web/src/games/yut/quick.tsx @@ -121,8 +121,8 @@ export const quickStart: QuickCard[] = [