sairate 7df250638d chore: 添加项目基础结构和示例代码
- 创建 .idea 目录和相关配置文件,设置项目结构
- 添加多个课堂成果示例代码,涵盖不同主题和功能
- 创建和配置 .gitignore 文件,忽略特定文件和目录
2025-07-05 09:36:00 +08:00

26 lines
1.0 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 3张藏宝图中的4个关键信息
map1 = {1:'女儿出嫁(打一字)',2:'向西走,回头看(打一方向)'}
map2 = {3:'由外西北广,于代宝玉来(打一地方)'}
map3 = {4:'一个字,八个头,里面有水不外流(打一字)'}
# 串联所有的藏宝图信息都存储在map1中
map1.update(map2)
map1.update(map3)
# 输出所有的谜题
print('''----开启宝藏的方法----
下面谜底连在一起为宝藏之谜
--------------------------''')
# 遍历字典的值,输出所有谜题
for i in map1.values():
print(i)
# 挨个询问谜底
ans1 = input('请猜测第一个谜底:')
ans2 = input('请猜测第二个谜底:')
ans3 = input('请猜测第三个谜底:')
ans4 = input('请猜测第四个谜底:')
# 如果谜底全部正确,则输出正确的藏宝地
if ans1 == '' and ans2 == '东侧' and ans3 == '庙宇' and ans4 == '':
print('''**** 恭喜你 ****
成功解开了宝藏之谜''')
print('宝藏位于:家东侧庙宇的井中')
else:
print('你所猜测的地方没有宝藏')