• 大小: 1.43MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-24
  • 语言: C#
  • 标签: 五子棋  C#五子棋  

资源简介

C#编写的五子棋源代码,功能比较全,是初学者不错的参考资料。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace FiveStone
{
    public partial class frm_main : Form
    {
        
        #region “自定义“
        private System.Drawing.Graphics g;
        private System.Drawing.Image image1 image2 image3 image4;
        private System.Drawing.Font font;
        private StreamWriter streamwrite;
        private StreamReader streamread;
        #endregion

        public frm_main()
        {
            InitializeComponent();

            #region “初始化“
            this.预放子ToolStripMenuItem.Checked = false;
            this.棋子兑换ToolStripMenuItem.Checked = false;
            this.电脑先行ToolStripMenuItem.Checked = false;
            this.玩家先行ToolStripMenuItem.Checked = true;
            this.双四禁手ToolStripMenuItem.Checked = false;
            this.image1 = Image.FromFile(Application.StartupPath + @“\Image\blackstone.gif“);
            this.image2 = Image.FromFile(Application.StartupPath + @“\Image\whitestone.gif“);
            this.image3 = Image.FromFile(Application.StartupPath + @“\Image\chessboard.gif“);
            this.image4 = Image.FromFile(Application.StartupPath + @“\Image\circle.bmp“);
            g = pictureBox.CreateGraphics();
            pictureBox2.Image = this.image1;
            pictureBox3.Image = this.image2;
            /////////////////////////////////////
            FontFamily fontFamily = new FontFamily(“Arial“);
            font = new Font(
                fontFamily
                15 Fontstyle.Regular
                GraphicsUnit.Pixel);
            PointF pointF = new PointF(10 10);
            SolidBrush solidBrush = new SolidBrush(Color.Black);
            #endregion 
        }

        private void 开始ToolStripMenuItem_Click(object sender EventArgs e)
        {
            #region
            smart.sequce = 0;
            smart.peace = 0;
            smart.win = 0;
            pictureBox.Refresh();   //清空棋盘
            //g.DrawImage(image300);
            for (int i = 0; i < 225; i++)
            {
                smart.pox[i] = 0;
                smart.poxcolor[i] = 0;
                smart.poxsequce[i] = 0;
            }
            this.textBox1.Text = ““;

            this.listBox.Items.Clear();
            #endregion
        }

        private void 电脑先行ToolStripMenuItem_Click(object sender EventArgs e)
        {
            #region
            int temp;
            this.电脑先行ToolStripMenuItem.Checked = true;
            this.玩家先行ToolStripMenuItem.Checked = false;
            smart.sequce = 0;
            smart.peace = 0;
            smart.win = 0;
            pictureBox.Refresh();
            //g.DrawImage(image300);
            for (int i = 0; i < 225; i++)
            {
                smart.pox[i] = 0;
                smart.poxcolor[i] = 0;
    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         76  2008-05-23 21:19  FiveStone\FiveStone\bin\Debug\aaa

     文件     221184  2008-05-23 21:37  FiveStone\FiveStone\bin\Debug\FiveStone.exe

     文件      69120  2008-05-23 21:37  FiveStone\FiveStone\bin\Debug\FiveStone.pdb

     文件       5632  2005-11-11 22:25  FiveStone\FiveStone\bin\Debug\FiveStone.vshost.exe

     文件       1723  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\blackstone.gif

     文件     164925  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\chessboard.gif

     文件        246  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\circle.bmp

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\FACE01.ICO

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\FACE02.ICO

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\FACE03.ICO

     文件        766  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\FACE04.ICO

     文件        766  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\FACE05.ICO

     文件       1270  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\Icon.bmp

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\rup_ps.ico

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\stone.ico

    ..A.SH.     23552  2008-05-25 10:58  FiveStone\FiveStone\bin\Debug\Image\Thumbs.db

     文件       1682  2008-05-22 22:27  FiveStone\FiveStone\bin\Debug\Image\whitestone.gif

     文件     366977  2008-05-23 20:55  FiveStone\FiveStone\bin\Debug.rar

     文件       3844  2008-05-23 20:16  FiveStone\FiveStone\FiveStone.csproj

     文件      37753  2008-05-23 22:02  FiveStone\FiveStone\frm_main.cs

     文件      21049  2008-05-23 22:02  FiveStone\FiveStone\frm_main.Designer.cs

     文件     259953  2008-05-23 22:02  FiveStone\FiveStone\frm_main.resx

     文件       1723  2008-05-22 22:27  FiveStone\FiveStone\Image\blackstone.gif

     文件     164925  2008-05-22 22:27  FiveStone\FiveStone\Image\chessboard.gif

     文件        246  2008-05-22 22:27  FiveStone\FiveStone\Image\circle.bmp

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\Image\FACE01.ICO

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\Image\FACE02.ICO

     文件       1078  2008-05-22 22:27  FiveStone\FiveStone\Image\FACE03.ICO

     文件        766  2008-05-22 22:27  FiveStone\FiveStone\Image\FACE04.ICO

     文件        766  2008-05-22 22:27  FiveStone\FiveStone\Image\FACE05.ICO

............此处省略34个文件信息

评论

共有 条评论