From f050dcc08d12612f9fe70924fc252f0674156c27 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 17 Oct 2026 16:19:51 +0900 Subject: [PATCH] =?UTF-8?q?fix(B06=20=ED=9A=A1=EB=8B=A8):=20=EB=84=98?= =?UTF-8?q?=EC=96=B4=EA=B0=84=20=EC=82=AC=EB=A9=B4=EC=9D=B4=20=EC=9B=90?= =?UTF-8?q?=EC=A7=80=EB=B0=98=EA=B3=BC=20=EB=AA=BB=20=EB=A7=8C=EB=82=98?= =?UTF-8?q?=EB=8F=84=20=EA=B3=A0=EB=A6=84=20=EC=9C=A0=EC=A7=80=20=E2=80=94?= =?UTF-8?q?=20=EA=B0=99=EC=9D=80=20=EC=AA=BD=20=EC=82=AC=EB=A9=B4=20?= =?UTF-8?q?=EC=84=A0=EC=9D=B4=20=EC=9D=B4=EC=96=B4=EB=B0=9B=EC=9D=8C=20(37?= =?UTF-8?q?0-5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - pickedLineAt — 키가 사라지면 같은 쪽 교차점 손잡이 → 그것도 없으면(사면 미교차) 같은 쪽 첫 절·성토 사면 선 - 손잡이(toe:) 를 고른 채 넘어가도 이어받음 — 고름이 풀려 공용 칸이 암 경계로 넘어가던 흠 - 시험: helper_370_2 「손잡이 없는 넘어감」 사례(성토 사면 · 「사면 이동 (우)」 · ◀↺▶) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL --- .../B06_Section_UI_Cross_Design_Pick.ts | 9 ++++-- resources/tester/helper_370_2_toe_stop.cjs | 28 +++++++++++++++++++ resources/tester/test_370_2_toe_stop.py | 10 +++++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/B06_Section/B06_Section_UI_Cross_Design_Pick.ts b/B06_Section/B06_Section_UI_Cross_Design_Pick.ts index 9ea0e2d1b..187d80178 100644 --- a/B06_Section/B06_Section_UI_Cross_Design_Pick.ts +++ b/B06_Section/B06_Section_UI_Cross_Design_Pick.ts @@ -299,9 +299,12 @@ export function pickedLineAt(stationId: string): number | null { if (picked?.stationId !== stationId) return null; const keys = keysByStation.get(stationId); let index = keys ? keys.indexOf(picked.key) : Number(picked.key); - // 사면이 절 ↔ 성으로 넘어가 키가 바뀌거나 길이 0 으로 사라지면 같은 쪽 교차점 손잡이(370-2) - const slope = /^(?:cut|fill)(?:\+s)?:(left|right):/.exec(picked.key); - if (index < 0 && keys && slope) index = keys.indexOf(`toe:${slope[1]}`); + // 사면이 절 ↔ 성으로 넘어가 키가 바뀌거나 길이 0 으로 사라지면 같은 쪽 교차점 손잡이(370-2) · + // 손잡이도 없으면(사면 미교차) 같은 쪽 첫 사면 선(370-5) — 고름이 풀려 암 칸으로 넘어가지 않게 + const side = /^(?:(?:cut|fill)(?:\+s)?|toe):(left|right)/.exec(picked.key)?.[1]; + if (index < 0 && keys && side) index = keys.indexOf(`toe:${side}`); + if (index < 0 && keys && side) + index = keys.findIndex((k) => k === `cut:${side}:0` || k === `fill:${side}:0`); return index >= 0 ? index : null; } export function setPickedLine(stationId: string, index: number | null): void { diff --git a/resources/tester/helper_370_2_toe_stop.cjs b/resources/tester/helper_370_2_toe_stop.cjs index 2b121d995..5bc7fabef 100644 --- a/resources/tester/helper_370_2_toe_stop.cjs +++ b/resources/tester/helper_370_2_toe_stop.cjs @@ -318,6 +318,34 @@ out.inherit = { after.handle.setActive(afterIndex); out.inherit.label = cellOf(after.handle).title; +// ⑤ 370-5 — 손잡이를 고른 뒤 넘어간 사면이 원지반과 못 만나면(손잡이 없음) 같은 쪽 첫 사면 선이 이어받음 +pick.setPickedLine("S1", null); +{ + const again = attach(near, []); + again.layer.children.filter((k) => k.classList.contains("b06-chart__toe-hit"))[1].click(); + pick.setPickedLine("S1", again.picks[0]); + let extend = crossing[1]; + let open = null; + while (extend < 10 && !open) { + extend = Math.round((extend + 0.5) * 10) / 10; + const sec = section(extend); + if (!pick.designLineMoves(sec, () => undefined).toes.right) open = sec; + } + const lost = attach(open, []); + const index = pick.pickedLineAt("S1"); + const piece = index === null ? null : lost.handle.pieces[index]; + lost.handle.setActive(index); + const cell = cellOf(lost.handle); + out.noToe = { + extend, + toeGone: !!open, + index, + zone: piece && pick.pieceZone(open.design, piece), + title: cell.title, + buttons: ["left", "reset", "right"].filter((slot) => cell.button(slot)), + }; +} + // ④ 정확히 0 자리(379-1) — 노견 끝 = 원지반(±5 mm = 절·성토 없음) · 손잡이 · 누르면 사면처럼 ◀↺▶ · 방향키 // 조각 0 은 안 봄 — 그림 규칙(노견 끝 → 첫 접점 보호 구간)이 지반 위 짧은 선을 남김(브레인 A) const zero = section(out.stop.value); diff --git a/resources/tester/test_370_2_toe_stop.py b/resources/tester/test_370_2_toe_stop.py index fe501353e..58204060c 100644 --- a/resources/tester/test_370_2_toe_stop.py +++ b/resources/tester/test_370_2_toe_stop.py @@ -60,6 +60,16 @@ def test_반올림이_교차_앞이어도_다음_걸음은_넘어감(out) -> Non assert abs(got["got"] - got["next"]) < 1e-9 # 0.936 → 1.036 꼴(제자리 아님) +def test_손잡이_없는_넘어감도_고름_유지(out) -> None: + """370-5 — 넘어간 사면이 원지반과 못 만나 손잡이가 사라져도 같은 쪽 사면 선 · 암 칸으로 안 넘어감.""" + got = out["noToe"] + assert got["toeGone"] is True + assert got["index"] is not None + assert got["zone"] == {"zone": "fill", "side": "right"} + assert got["title"] == "사면 이동 (우)" + assert got["buttons"] == ["left", "reset", "right"] # ◀↺▶ 남음 + + def test_교차점_손잡이_쪽마다_늘_보임(out) -> None: toe = out["toe"] assert toe["count"] == len(toe["sides"]) == 2