Spaces:
Running
Running
| """ | |
| World Model Bench โ Scoring Verification Suite v1.0 | |
| ๋ชฉ์ : ์ฑ์ ํจ์์ ๋ชจ๋ ๋ถ๊ธฐ๋ฅผ ํ ์คํธํ์ฌ | |
| "๋๊ฐ ๋๋ ค๋ ๊ฐ์ ์ ์" ๋ณด์ฅ | |
| ๊ฒ์ฆ ๋ฒ์: | |
| - ํ์ ์ฃ์ง์ผ์ด์ค (๋น ์ ๋ ฅ, ์๋ชป๋ ํฌ๋งท, ๋์๋ฌธ์ ๋ฑ) | |
| - 10๊ฐ ์ฑ์ ํจ์ ร ๋ชจ๋ ์ ์ ๋ถ๊ธฐ | |
| - ๊ฒฝ๊ณ๊ฐ ํ ์คํธ (0์ , ๋ง์ , ๋ถ๋ถ ์ ์) | |
| - ํตํฉ ์ ์ ๊ณ์ฐ + ๋ฑ๊ธ ๊ฒฝ๊ณ | |
| """ | |
| import sys | |
| sys.path.insert(0, '/mnt/user-data/outputs') | |
| from wm_bench_scoring import ( | |
| parse_predict_line, parse_motion_line, PredictDirection, | |
| get_action_intensity, get_emotion_intensity, get_motion_direction, | |
| count_descriptors, | |
| score_c01, score_c02, score_c03, score_c04, score_c05, | |
| score_c06, score_c07, score_c08, score_c09, score_c10, | |
| calculate_wm_score, | |
| ) | |
| passed = 0 | |
| failed = 0 | |
| total = 0 | |
| def check(test_name, condition, detail=""): | |
| global passed, failed, total | |
| total += 1 | |
| if condition: | |
| passed += 1 | |
| print(f" โ {test_name}") | |
| else: | |
| failed += 1 | |
| print(f" โ {test_name} โ {detail}") | |
| print("=" * 70) | |
| print(" WM Bench Scoring Verification Suite") | |
| print("=" * 70) | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[1/12] ํ์: parse_predict_line") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| # ์ ์ ์ ๋ ฅ | |
| p = parse_predict_line("PREDICT: left=safe(open), right=danger(wall), fwd=danger(beast), back=safe") | |
| check("์ ์ ํ์ฑ 4๋ฐฉํฅ", len(p) == 4) | |
| check("left=safe", p["left"].is_safe and not p["left"].is_danger) | |
| check("right=danger", p["right"].is_danger and not p["right"].is_safe) | |
| check("right reason=wall", p["right"].reason == "wall") | |
| check("fwd reason=beast", p["fwd"].reason == "beast") | |
| check("back=safe no reason", p["back"].is_safe and p["back"].reason is None) | |
| # ๋์๋ฌธ์ ํผํฉ | |
| p2 = parse_predict_line("PREDICT: Left=Safe(Open), RIGHT=DANGER(WALL), FWD=danger(Beast), Back=safe") | |
| check("๋์๋ฌธ์ left safe", p2["left"].is_safe) | |
| check("๋์๋ฌธ์ right danger", p2["right"].is_danger) | |
| check("๋์๋ฌธ์ reason", p2["right"].reason == "wall") | |
| # forward/backward ์ ๊ทํ | |
| p3 = parse_predict_line("PREDICT: left=safe, right=safe, forward=danger(wall), backward=safe") | |
| check("forwardโfwd ์ ๊ทํ", "fwd" in p3) | |
| check("backwardโback ์ ๊ทํ", "back" in p3) | |
| # ๋น ์ ๋ ฅ | |
| p4 = parse_predict_line("") | |
| check("๋น ์ ๋ ฅ ๋น ๊ฒฐ๊ณผ", len(p4) == 0) | |
| # PREDICT: ์๋ ๊ฒฝ์ฐ | |
| p5 = parse_predict_line("left=safe, right=danger(wall)") | |
| check("PREDICT: ์์ด๋ ํ์ฑ", len(p5) >= 2) | |
| # ์ด์ ์๋ danger | |
| p6 = parse_predict_line("PREDICT: left=danger, right=safe") | |
| check("์ด์ ์๋ danger", p6["left"].is_danger and p6["left"].reason is None) | |
| # ๊ณต๋ฐฑ ๋ง์ ๊ฒฝ์ฐ | |
| p7 = parse_predict_line("PREDICT: left = safe(open) , right = danger( wall ) ") | |
| check("๊ณต๋ฐฑ ๊ณผ๋ค ํ์ฑ", "left" in p7 or len(p7) >= 1) | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[2/12] ํ์: parse_motion_line") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| m1 = parse_motion_line("MOTION: a person sprinting right in terror") | |
| check("์ ์ ํ์ฑ", m1 == "a person sprinting right in terror") | |
| m2 = parse_motion_line("MOTION:a person walking forward") | |
| check("๊ณต๋ฐฑ ์์ด", "walking forward" in m2) | |
| m3 = parse_motion_line("a person just walking") | |
| check("MOTION: ์์ด๋", "walking" in m3) | |
| m4 = parse_motion_line("MOTION: A Person SPRINTING LEFT") | |
| check("๋์๋ฌธ์ ์๋ฌธ์ํ", "sprinting" in m4) | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[3/12] ํค์๋ ์ฌ์ : ํ๋ ๊ฐ๋") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| check("sprint=4", get_action_intensity("sprinting away") == 4) | |
| check("walk=2", get_action_intensity("walking slowly") == 2) | |
| check("desperate=5", get_action_intensity("desperate escape") == 5) | |
| check("stand=1", get_action_intensity("standing still") == 1) | |
| check("๋น ํ ์คํธ=0", get_action_intensity("") == 0) | |
| check("๋ณตํฉ: sprint+desperate=5", get_action_intensity("desperately sprinting") == 5) | |
| check("unknown word=0", get_action_intensity("xyzzy foobar") == 0) | |
| check("freeze=1", get_action_intensity("freezing in place") == 1) | |
| check("run=4", get_action_intensity("running fast") == 4) | |
| check("jog=3", get_action_intensity("jogging ahead") == 3) | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[4/12] ํค์๋ ์ฌ์ : ๊ฐ์ ๊ฐ๋") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| check("terror=5", get_emotion_intensity("in terror") == 5) | |
| check("fear=4", get_emotion_intensity("with fear") == 4) | |
| check("anxious=3", get_emotion_intensity("feeling anxious") == 3) | |
| check("cautious=2", get_emotion_intensity("being cautious") == 2) | |
| check("calm=1", get_emotion_intensity("staying calm") == 1) | |
| check("๋น=0", get_emotion_intensity("") == 0) | |
| check("terrified=5", get_emotion_intensity("terrified") == 5) | |
| check("๋ณตํฉ: terror+fear=5", get_emotion_intensity("terrified with fear") == 5) | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[5/12] ํค์๋ ์ฌ์ : ๋ฐฉํฅ ์ถ์ถ") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| check("right", get_motion_direction("sprinting right") == "right") | |
| check("left", get_motion_direction("moving left") == "left") | |
| check("forwardโfwd", get_motion_direction("walking forward") == "fwd") | |
| check("backwardโback", get_motion_direction("stepping backward") == "back") | |
| check("aroundโback", get_motion_direction("turning around") == "back") | |
| check("์์โNone", get_motion_direction("a person standing still") is None) | |
| check("aheadโfwd", get_motion_direction("running ahead") == "fwd") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[6/12] C01: ํ๊ฒฝ ์ธ์ ์ ํ๋") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| gt = {"left": "safe", "right": "danger", "fwd": "danger", "back": "safe"} | |
| # ๋ง์ | |
| p = parse_predict_line("PREDICT: left=safe, right=danger(wall), fwd=danger(beast), back=safe") | |
| s, r = score_c01({}, p, gt) | |
| check("4/4 ์ ํ = 20์ ", s == 20) | |
| # 3/4 | |
| p = parse_predict_line("PREDICT: left=safe, right=danger(wall), fwd=safe, back=safe") | |
| s, r = score_c01({}, p, gt) | |
| check("3/4 ์ ํ = 15์ ", s == 15) | |
| # 2/4 | |
| p = parse_predict_line("PREDICT: left=safe, right=safe, fwd=safe, back=safe") | |
| s, r = score_c01({}, p, gt) | |
| check("2/4 ์ ํ = 10์ ", s == 10) | |
| # 0/4 | |
| p = parse_predict_line("PREDICT: left=danger, right=safe, fwd=safe, back=danger") | |
| s, r = score_c01({}, p, gt) | |
| check("0/4 ์ ํ = 0์ ", s == 0) | |
| # ๋ถ๋ถ ์ถ๋ ฅ (2๋ฐฉํฅ๋ง) | |
| p = parse_predict_line("PREDICT: left=safe, right=danger(wall)") | |
| s, r = score_c01({}, p, gt) | |
| check("2๋ฐฉํฅ๋ง ์ถ๋ ฅ (fwd,back ๋๋ฝ)", s <= 10) | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[7/12] C02: ๊ฐ์ฒด ์ธ์ ๋ฐ ๋ถ๋ฅ") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| # ๋ง์ : ๋งน์ ์ ํ ์ธ์ | |
| gt = {"entity_type": "beast", "entity_direction": "fwd", "is_threat": True} | |
| p = parse_predict_line("PREDICT: left=safe, right=safe, fwd=danger(beast), back=safe") | |
| s, r = score_c02({}, p, gt) | |
| check("๋งน์ ์๋ฒฝ ์ธ์ = 20์ ", s == 20, f"got {s}") | |
| # ์ ํ ์ค์ธ: beast๋ฅผ woman์ผ๋ก | |
| p = parse_predict_line("PREDICT: left=safe, right=safe, fwd=danger(woman), back=safe") | |
| s, r = score_c02({}, p, gt) | |
| check("์ ํ ์ค์ธ < 20์ ", s < 20 and s > 0, f"got {s}") | |
| # ๋ฐฉํฅ ์ค์ธ | |
| p = parse_predict_line("PREDICT: left=danger(beast), right=safe, fwd=safe, back=safe") | |
| s, r = score_c02({}, p, gt) | |
| check("๋ฐฉํฅ ์ค์ธ < 15์ ", s < 15, f"got {s}") | |
| # ๊ฐ์ฒด ์์ ์ ํ | |
| gt_none = {"entity_type": None, "entity_direction": None, "is_threat": False} | |
| p = parse_predict_line("PREDICT: left=safe, right=safe, fwd=safe, back=safe") | |
| s, r = score_c02({}, p, gt_none) | |
| check("๊ฐ์ฒด ์์ ์ ํ = 20์ ", s == 20, f"got {s}") | |
| # ๊ฐ์ฒด ์๋๋ฐ danger ์ค์ธ | |
| p = parse_predict_line("PREDICT: left=safe, right=danger(beast), fwd=safe, back=safe") | |
| s, r = score_c02({}, p, gt_none) | |
| check("์๋๋ฐ ์ค์ธ = 10์ ", s == 10, f"got {s}") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[8/12] C03: ์์ธก ๊ธฐ๋ฐ ์ถ๋ก ") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| gt = { | |
| "danger_directions": ["fwd", "left"], | |
| "safe_directions": ["right", "back"], | |
| "optimal_direction": "right", | |
| } | |
| # ๋ง์ : ์ต์ ๋ฐฉํฅ + safe + PREDICT ์ผ๊ด | |
| p = parse_predict_line("PREDICT: left=danger(wall), right=safe(open), fwd=danger(beast), back=safe") | |
| s, r = score_c03({}, p, "a person sprinting right away from beast", gt) | |
| check("์ต์ ๋ฐฉํฅ ์ ํ = 20์ ", s == 20, f"got {s}") | |
| # ์ฐจ์ : back ์ ํ (safe์ด์ง๋ง optimal ์๋) | |
| s, r = score_c03({}, p, "a person running backward quickly", gt) | |
| check("์ฐจ์ ๋ฐฉํฅ back = 16์ ", s == 16, f"got {s}") | |
| # ์ํ ๋ฐฉํฅ ์ ํ | |
| s, r = score_c03({}, p, "a person walking forward slowly", gt) | |
| check("danger ๋ฐฉํฅ fwd = ๋ฎ์ ์ ์", s <= 8, f"got {s}") | |
| # ๋ฐฉํฅ ํค์๋ ์์ | |
| s, r = score_c03({}, p, "a person standing in panic", gt) | |
| check("๋ฐฉํฅ ์์ = ๋ถ๋ถ ์ ์", 0 <= s <= 10, f"got {s}") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[9/12] C04: ์ํ ์ฐจ๋ณ ๋ฐ์") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| gt = {"expected_a_higher": True, "min_intensity_diff": 2} | |
| # ๋ง์ : A ๊ฐํจ, B ์ฝํจ, ์ฐจ์ด ์ถฉ๋ถ | |
| s, r = score_c04("a person sprinting away in terror", "a person walking away cautiously", gt) | |
| check("sprint(5) vs walk(2) = 20์ ", s == 20, f"got {s}") | |
| # ๋์ผ ๊ฐ๋ | |
| s, r = score_c04("a person walking forward", "a person walking slowly", gt) | |
| check("๋์ผ ๊ฐ๋ = ๋ฎ์ ์ ์", s <= 10, f"got {s}") | |
| # ์ญ์ : B๊ฐ ๋ ๊ฐํจ (๊ฐ๋ ์ฐจ์ด๋ ์์ผ๋ฏ๋ก ๋ถ๋ถ ์ ์) | |
| s, r = score_c04("a person standing still", "a person sprinting away", gt) | |
| check("์ญ์ = ๋ถ๋ถ ์ ์ (๊ฐ๋ ์ฐจ์ด๋ ์ธ์ )", 8 <= s <= 14, f"got {s}") | |
| # ์์ชฝ ์ ๊ฐ๋ ๋ฐ์ (์ฐจ์ด ์์) | |
| s, r = score_c04("a person looking around", "a person standing there", gt) | |
| check("์์ชฝ ์ ๊ฐ๋ = ๋ถ๋ถ ์ ์", 4 <= s <= 8, f"got {s}") | |
| # ์ฐจ์ด ์์ง๋ง ๋ถ์กฑ | |
| s, r = score_c04("a person jogging away", "a person walking forward", gt) | |
| check("์ฐจ์ด 1 < min_diff 2", s < 20, f"got {s}") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[10/12] C05: ๊ฐ์ ์์ค์ปฌ๋ ์ด์ ") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| # ๋ง์ : ์ฆ๊ฐ ์ถ์ธ | |
| s, r = score_c05([ | |
| "a person stepping back", | |
| "a person running away in fear", | |
| "a person desperately fleeing in terror", | |
| ], {"expected_trend": "increasing"}) | |
| check("์ฆ๊ฐ ์ถ์ธ = ๋์ ์ ์", s >= 16, f"got {s}") | |
| # ๊ฐ์ ์ถ์ธ (๊ธฐ๋: ๊ฐ์) | |
| s, r = score_c05([ | |
| "a person sprinting in terror", | |
| "a person jogging cautiously", | |
| "a person walking calmly", | |
| ], {"expected_trend": "decreasing"}) | |
| check("๊ฐ์ ์ถ์ธ = ๋์ ์ ์", s >= 16, f"got {s}") | |
| # ์์ (๊ธฐ๋: ์์ ) | |
| s, r = score_c05([ | |
| "a person walking forward", | |
| "a person walking ahead", | |
| "a person walking steadily", | |
| ], {"expected_trend": "stable"}) | |
| check("์์ ์ ์ง = ๋์ ์ ์", s >= 14, f"got {s}") | |
| # ์ญ์ (๊ธฐ๋: ์ฆ๊ฐ์ธ๋ฐ ๊ฐ์) | |
| s, r = score_c05([ | |
| "a person desperately fleeing", | |
| "a person walking calmly", | |
| "a person standing still", | |
| ], {"expected_trend": "increasing"}) | |
| check("์ญ์ = ๋ฎ์ ์ ์", s <= 8, f"got {s}") | |
| # ์ํ์ค 1๊ฐ๋ง | |
| s, r = score_c05(["a person walking"], {"expected_trend": "increasing"}) | |
| check("์ํ์ค 1๊ฐ = 0์ ", s == 0) | |
| # 4๊ฐ ์ํ์ค ๋จ์กฐ ์ฆ๊ฐ | |
| s, r = score_c05([ | |
| "a person standing still", | |
| "a person stepping back", | |
| "a person running away", | |
| "a person desperately sprinting in terror", | |
| ], {"expected_trend": "increasing"}) | |
| check("4๋จ๊ณ ๋จ์กฐ ์ฆ๊ฐ", s >= 18, f"got {s}") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[11/12] C08: ๋ชจ์ ํํ๋ ฅ") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| gt_high = {"expected_min_intensity": 4, "expected_emotion": True, "expected_min_descriptors": 2} | |
| gt_low = {"expected_min_intensity": 1, "expected_emotion": False, "expected_min_descriptors": 1} | |
| # ๋ง์ : ํ๋ถํ ํํ | |
| s, r = score_c08("a person desperately sprinting right in terror", gt_high) | |
| check("ํ๋ถํ ํํ = 20์ ", s == 20, f"got {s}") | |
| # ๊ฐ์ ์๋ ํํ (๊ธฐ๋: ๊ฐ์ ์์) | |
| s, r = score_c08("a person moving right", gt_high) | |
| check("๊ฐ์ ์์ < ๋ง์ ", s < 15, f"got {s}") | |
| # ํ์์ (๊ธฐ๋: ๊ฐ์ ์์) | |
| s, r = score_c08("a person walking forward steadily", gt_low) | |
| check("ํ์์ ์ ์ = ๋์ ์ ์", s >= 14, f"got {s}") | |
| # ๋๋ฌด ๊ธด ํ ์คํธ | |
| long_motion = "a person " + " ".join(["really"] * 25) + " running" | |
| s, r = score_c08(long_motion, gt_high) | |
| check("30๋จ์ด ์ด๊ณผ = ๊ธธ์ด ๊ฐ์ ", s < 20, f"got {s}") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[12/12] C09: ์ค์๊ฐ ์ฑ๋ฅ") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| # ๋ง์ | |
| s, r = score_c09({"fps": 50, "cognitive_latency_ms": 2000, "frame_drop_rate": 0.005, "gpu_memory_stable": True}) | |
| check("์๋ฒฝ ์ฑ๋ฅ = 20์ ", s == 20) | |
| # ์ต์ | |
| s, r = score_c09({"fps": 20, "cognitive_latency_ms": 8000, "frame_drop_rate": 0.03, "gpu_memory_stable": True}) | |
| check("์ต์ ์ฑ๋ฅ", 5 <= s <= 12, f"got {s}") | |
| # ๋ฏธ๋ฌ | |
| s, r = score_c09({"fps": 5, "cognitive_latency_ms": 15000, "frame_drop_rate": 0.1, "gpu_memory_stable": False}) | |
| check("๋ฏธ๋ฌ ์ฑ๋ฅ = ๋ฎ์ ์ ์", s <= 3, f"got {s}") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n[BONUS] ํตํฉ ์ ์ + ๋ฑ๊ธ ๊ฒฝ๊ณ") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| # S๋ฑ๊ธ ๊ฒฝ๊ณ | |
| r = calculate_wm_score({"C01":100,"C02":100,"C03":100,"C04":100,"C05":100,"C06":100,"C07":100,"C08":100,"C09":100,"C10":100}) | |
| check(f"๋ง์ = {r['wm_score']} (S๋ฑ๊ธ)", r["grade"] == "S" and r["wm_score"] == 1000) | |
| # A๋ฑ๊ธ ๊ฒฝ๊ณ | |
| r = calculate_wm_score({"C01":80,"C02":80,"C03":80,"C04":80,"C05":80,"C06":80,"C07":80,"C08":80,"C09":80,"C10":80}) | |
| check(f"80์ ๋ = {r['wm_score']} ({r['grade']}๋ฑ๊ธ)", r["wm_score"] >= 750) | |
| # B๋ฑ๊ธ | |
| r = calculate_wm_score({"C01":65,"C02":75,"C03":85,"C04":90,"C05":85,"C06":60,"C07":70,"C08":80,"C09":85,"C10":35}) | |
| check(f"VIDRAFT ๊ธฐ์ค์ = {r['wm_score']} ({r['grade']}๋ฑ๊ธ)", r["grade"] in ("B", "A")) | |
| # F๋ฑ๊ธ | |
| r = calculate_wm_score({"C01":10,"C02":10,"C03":10,"C04":10,"C05":10,"C06":10,"C07":10,"C08":10,"C09":10,"C10":10}) | |
| check(f"์ต์ = {r['wm_score']} ({r['grade']}๋ฑ๊ธ)", r["wm_score"] < 200) | |
| # 0์ | |
| r = calculate_wm_score({"C01":0,"C02":0,"C03":0,"C04":0,"C05":0,"C06":0,"C07":0,"C08":0,"C09":0,"C10":0}) | |
| check(f"0์ = {r['wm_score']} ({r['grade']}๋ฑ๊ธ)", r["wm_score"] == 0 and r["grade"] == "F") | |
| # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| print("\n" + "=" * 70) | |
| print(f" ๊ฒฐ๊ณผ: {passed}/{total} ํต๊ณผ, {failed}/{total} ์คํจ") | |
| if failed == 0: | |
| print(" โ ๋ชจ๋ ํ ์คํธ ํต๊ณผ โ ์ฑ์ ์์คํ ๊ฒ์ฆ ์๋ฃ") | |
| else: | |
| print(f" โ {failed}๊ฐ ์คํจ โ ์์ ํ์") | |
| print("=" * 70) | |