- 博客(11)
- 收藏
- 关注
原创 Python游戏(二):扫雷并AI脚本
self.new_game_btn = tk.Button(self.control_frame, text="新游戏", command=self.new_game)self.solve_btn = tk.Button(self.control_frame, text="AI求解", command=self.ai_solve)messagebox.showinfo("游戏结束", "踩到地雷了!self.master.title("扫雷游戏")# 递归显示周围的格子。"""递归显示空白格子"""
2025-01-05 22:06:01
621
原创 Python做游戏(一):猜数字游戏并带AI脚本
title_label = tk.Label(self.window, text='猜数字游戏\n请在0~1024中猜测数字', font=('Arial', 14))quit_button = tk.Button(button_frame, text='结束游戏', command=self.window.quit)\n用了 {len(guesses)} 次猜对\n')history_str = '历史猜测记录:\n' + ', '.join(map(str, self.history))
2025-01-05 22:05:23
818
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅
1