打印本文 打印本文 关闭窗口 关闭窗口
使用vb.net实现五子棋的人工智能5电脑算法2
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2498  更新时间:2009/4/23 19:01:34  文章录入:mintao  责任编辑:mintao
        Next

        If cs > ps Then

            yuandian(a * 30 + 10, b * 30 + 10)

            table(a, b) = 1

            For i = 0 To 191

                If pwin(a, b, i) = True Then

                    pflag(i) = False

                End If

            Next

        Else

            yuandian(c * 30 + 10, d * 30 + 10)

            table(c, d) = 1

            For i = 0 To 191

                If pwin(c, d, i) = True Then

                    pflag(i) = False

                End If

            Next

        End If

        '''''''''''' ********                    分值比较算法结束                        ********

        checkwin()

End Sub

 

七,绘制棋子

 

    ''''*****************************************************************************

    ''''** 模块名称:  yuandian

    ''''**

    ''''** 描述:   此函数主要进行电脑棋子的绘制。

    ''''**

    ''''*****************************************************************************

 

    Sub yuandian(ByVal x As Integer, ByVal y As Integer)

        Dim mycolor As Color

        Dim g As System.Drawing.Graphics

        g = PictureBox1.CreateGraphics

        Dim zhx, zhy As Integer

        zhx = Int((x - 10) / 30)

        zhy = Int((y - 10) / 30)

        mycolor = Color.Black

        Dim brush1 As System.Drawing.Brush = New SolidBrush(mycolor)

        g.FillEllipse(brush1, zhx * 30 + 10, zhy * 30 + 10, 30, 30)

    End Sub

 

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口