예외누적

2026년 11월 30일 09:30분

열왕기상 11장에서 솔로몬은 이방 여인을 많이 들이고, 그 마음이 다른 신들을 향합니다. 작은 예외가 쌓여 하나님은 나라를 나누겠다고 선언하십니다. 나는 예외 항목이 기준치를 넘으면 전체 설정을 막는 검사기를 구현했습니다.

package com.jesusbornd.kings1;

import java.util.List;

public class Kings1_11_Chapter_Lv2 {
    static final int LIMIT = 3;
    static void check(List<String> exceptions) {
        System.out.println("예외 " + exceptions.size() + "건: " + exceptions);
        if (exceptions.size() > LIMIT) {
            System.out.println("⛔ 기준 초과 — 나라 분열 선언, 설정 차단");
        } else {
            System.out.println("✅ 기준 내 — 운영 유지");
        }
    }
    public static void main(String[] args) {
        check(List.of("이방 신 제단"));
        check(List.of("이방 여인 A", "이방 여인 B", "이방 신 제단", "에돔 적대"));
    }
}

LIMIT = 3

def check(exceptions: list[str]):
    print(f"예외 {len(exceptions)}건: {exceptions}")
    if len(exceptions) > LIMIT:
        print("⛔ 기준 초과 — 나라 분열 선언, 설정 차단")
    else:
        print("✅ 기준 내 — 운영 유지")

check(["이방 신 제단"])
check(["이방 여인 A", "이방 여인 B", "이방 신 제단", "에돔 적대"])

Comments

Avatar
 2026년 11월 30일 11:38분

예외는 하나씩 보면 작아도 쌓이면 구조를 무너뜨립니다.



Search

← 목록으로