所需图片:设计游戏窗体(form1
cs)创建新 Windows 应用程序项目, 在新窗体上添加1 个图片框 picturebox1(显示 ABC 三个柱子背景)、1 个文本框 textbox1(用来设置盘子的数量)、1 个标签 label(text 设置为盘子数)添加两个按钮(button) text 属性为“开始游戏”和自动演化实现代码//代码测试都可以使用不懂联系邮箱:1278263100@qq
com using System; using System
Collections
Generic; using System
ComponentModel; using System
Data; using System
Drawing; using System
Text; using System
Windows
Forms; using System
Collections; namespace 汉诺塔递归{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private int i; // 移动的次数public PictureBox[] Plate = new PictureBox[11]; const int PlateHeight = 17; // 盘片厚度private bool isDragging = false; private int x1, y1; private ArrayList A = new ArrayList(); private ArrayList B = new ArrayList(); private ArrayList C = new ArrayList(); //ArrayList 就是数组列表,它位于System