steveyehtw commited on
Commit
2bcacf0
·
verified ·
1 Parent(s): 3c5a598

Checkpoint 26FSunAft 游允樂 week02

Browse files
classroom_data/versions/26FSunAft/游允樂/week02/1789889349090-checkpoint-308208.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "class_code": "26FSunAft",
3
+ "student_id": "游允樂",
4
+ "display_name": "游允樂",
5
+ "week_id": "week02",
6
+ "version_id": "1789889349090-checkpoint-308208",
7
+ "kind": "checkpoint",
8
+ "project_name": "",
9
+ "created_at": 1789889349090,
10
+ "files": {
11
+ "main.py": "CASE_TITLE = \"米血(土撥鼠)跟泡麵頭的病房!!!!!!!!!!!!\"\nLOCATIONS = {\n 1: {\n \"name\": \"凌晨三點的病房\",\n \"scene\": \"電線並不是連到牆上的插座。而是穿過牆壁。\",\n # 在證物敘述中提示密碼\n \"evidence\": \"五年前的醫療紀錄。桌上還有一本筆記本,最後一頁寫著時間:【0607】\",\n \"password\": None, # 第一關不需要密碼\n },\n 2: {\n \"name\": \"密室\",\n \"scene\": \"筆記本寫:如果有人發現這個房間,代表事情終於藏不住了。\",\n # 在證物敘述中提示下一關密碼\n \"evidence\": \"消失的米血(土撥鼠):他的名字從醫院大部分的舊資料裡消失了。邊角留有一行員工編號:【9527】\",\n \"password\": \"0607\", # 密碼藏在第 1 關的證物裡\n },\n 3: {\n \"name\": \"密室裡的秘密\",\n \"scene\": \"米血(土撥鼠)跟泡麵頭 死亡原因:心臟驟停。\",\n \"evidence\": \"護理站的鈴聲突然響起\",\n \"password\": \"9527\", # 密碼藏在第 2 關的證物裡\n },\n}\n\nevidence_bag = []\n\ndef investigate(location_id):\n \"\"\"調查地點並將新線索放入證物袋(加入順序限制與密碼鎖驗證)。\"\"\"\n if location_id not in LOCATIONS:\n print(\"\\n[提示] 錯誤編號,沒這個地點!\")\n return\n \n # 1. 嚴格順序檢查:必須先調查完前一關才能去下一關\n if location_id > 1 and (location_id - 1) not in evidence_bag:\n print(f\"\\n❌ 調查失敗!你還沒找到去往「{LOCATIONS[location_id]['name']}」的線索。\")\n print(f\"👉 請照順序,先去調查「{LOCATIONS[location_id - 1]['name']}」。\")\n return\n\n target_location = LOCATIONS[location_id]\n\n # 2. 密碼鎖檢查\n if target_location[\"password\"] is not None:\n print(f\"\\n🔒 這裡被密碼鎖鎖上了!\")\n input_pwd = input(f\"請輸入進入「{target_location['name']}」的密碼:\").strip()\n if input_pwd != target_location[\"password\"]:\n print(\"❌ 密碼錯誤!門鎖紋絲不動...(提示:密碼藏在前一個地點的證物中)\")\n return\n else:\n print(\"🔓 密碼正確!門鎖『咔噠』一聲打開了。\")\n \n print(f\"\\n你來到了:{target_location['name']}\")\n print(f\"現場描述:{target_location['scene']}\")\n \n # 線索尚未取得時才存入 evidence_bag\n if location_id not in evidence_bag:\n evidence_bag.append(location_id)\n print(f\"【成功取得證物】: {target_location['evidence']}\")\n else:\n print(\"(這裡的線索你之前已經拿過了。)\")\n\ndef show_evidence():\n \"\"\"列出目前取得的所有證物。\"\"\"\n if not evidence_bag:\n print(\"\\n證物袋目前空空如也!\")\n else:\n print(\"\\n=== 目前收集到的證物 ===\")\n for idx, loc_id in enumerate(evidence_bag, 1):\n print(f\"編號 {idx}: {LOCATIONS[loc_id]['evidence']}\")\n\ndef make_deduction():\n \"\"\"取得足夠證物後,讓玩家選擇真相。\"\"\"\n if len(evidence_bag) < 3:\n print(f\"\\n證物不足:目前 {len(evidence_bag)}/3。再去調查吧!\")\n return False\n \n print(\"\\n哪一個說法最符合所有證物?(只有一個對)\")\n print(\"1. 有人把米血(土撥鼠) 跟泡麵頭殺了\")\n print(\"2. 米血(土撥鼠)跟泡麵頭自殺了\")\n print(\"3. 他被鬼帶走了\")\n \n answer = input(\"你的推理(請輸入數字):\").strip()\n \n if answer == \"1\":\n print(\"\\n恭喜你!推理正確!你成功破案了!米血=土撥鼠 土撥鼠=米血!!! \")\n return True\n else:\n print(\"\\n這個推理似乎有點破綻...再想想看!\")\n return False\n\ndef show_menu():\n \"\"\"顯示主要功能選單\"\"\"\n print(f\"\\n=== 調查局選單:{CASE_TITLE} ===\")\n print(f\"1. 調查 {LOCATIONS[1]['name']}\")\n print(f\"2. 調查 {LOCATIONS[2]['name']}\")\n print(f\"3. 調查 {LOCATIONS[3]['name']}\")\n print(\"4. 查看證物袋\")\n print(\"5. 提出推理\")\n print(\"6. 離開\")\n\ndef main():\n print(\"現在是 6:07 分,你能破案嗎?\")\n while True:\n show_menu()\n choice = input(\"\\n請選擇功能 (1~6):\").strip()\n \n # 判斷輸入是否為 1~3 的調查地點\n if choice in [\"1\", \"2\", \"3\"]:\n investigate(int(choice))\n elif choice == \"4\":\n show_evidence()\n elif choice == \"5\":\n if make_deduction():\n break\n elif choice == \"6\":\n print(\"\\n案件暫停。證物袋已交回調查局。\")\n break\n else:\n print(\"\\n無效的輸入,請輸入 1~6。\")\n\nif __name__ == \"__main__\":\n main()"
12
+ }
13
+ }