MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / mode_practice

Function mode_practice

Scripts/Games/Buzz.py:1125–1143  ·  view source on GitHub ↗
(db, cfg, profiles, present_categories)

Source from the content-addressed store, hash-verified

1123 finalize_game("High Stakes (mode)", difficulty, profiles, hs, players, scores, {"category": cat, "questions": total}, save=True)
1124
1125def mode_practice(db, cfg, profiles, present_categories):
1126 difficulty = choose_difficulty()
1127 clear()
1128 print("=== PRACTICE (not saved) ===\n")
1129 cat = choose_category_menu(present_categories)
1130 pool = build_pool(db, cat, difficulty)
1131 rng = random.Random()
1132 while True:
1133 clear()
1134 print(f"Practice | Category: {cat} | Diff: {difficulty}\n")
1135 ok, took, to, ans = ask_question(rng.choice(pool), 0)
1136 if ok:
1137 print("\n✅ Correct!")
1138 else:
1139 print("\n❌ Wrong.")
1140 print("Answer:", ans)
1141 c = input("\nENTER=next | q=quit : ").strip().lower()
1142 if c == "q":
1143 return
1144
1145# -------------------- Settings menu --------------------
1146def load_settings() -> dict:

Callers 1

mainFunction · 0.70

Calls 7

printFunction · 0.85
inputFunction · 0.85
choose_difficultyFunction · 0.70
clearFunction · 0.70
choose_category_menuFunction · 0.70
build_poolFunction · 0.70
ask_questionFunction · 0.70

Tested by

no test coverage detected