当前位置: 网学 > 编程文档 > VB > 正文

用VB实现井字游戏

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式
Wells_Value
    intWinCase(5) = usrWells(2).Wells_Value + usrWells(5).Wells_Value + usrWells(8).Wells_Value
    intWinCase(6) = usrWells(3).Wells_Value + usrWells(6).Wells_Value + usrWells(9).Wells_Value
    intWinCase(7) = usrWells(1).Wells_Value + usrWells(5).Wells_Value + usrWells(9).Wells_Value
    intWinCase(8) = usrWells(3).Wells_Value + usrWells(5).Wells_Value + usrWells(7).Wells_Value
    Select Case PlayerType
       Case MAN
          If intWinCase(1) = 3 Or intWinCase(2) = 3 Or intWinCase(3) = 3 Or intWinCase(4) = 3 Or _
             intWinCase(5) = 3 Or intWinCase(6) = 3 Or intWinCase(7) = 3 Or intWinCase(8) = 3 Then
             blnPlayerWin = True
             blnPlayerLost = False
             funPlayerWinIF = blnPlayerWin
          End If
       Case COMPUTER
          If intWinCase(1) = -3 Or intWinCase(2) = -3 Or intWinCase(3) = -3 Or intWinCase(4) = -3 Or _
             intWinCase(5) = -3 Or intWinCase(6) = -3 Or intWinCase(7) = -3 Or intWinCase(8) = -3 Then
             blnPlayerWin = False
             blnPlayerLost = True
             funPlayerWinIF = blnPlayerLost
          End If
    End Select
End Function

''该自定义函数用于返回机器的落子
Private Function funGetPCWells() As Integer
    Dim intWells(1 To 8) As Integer, intPCRandomWells As Integer
    intWells(1) = usrWells(1).Wells_Value + usrWells(2).Wells_Value + usrWells(3).Wells_Value
    intWells(2) = usrWells(4).Wells_Value + usrWells(5).Wells_Value + usrWells(6).Wells_Value
    intWells(3) = usrWells(7).Wells_Value + usrWells(8).Wells_Value + usrWells(9).Wells_Value
    intWells(4) = usrWells(1).Wells_Value + usrWells(4).Wells_Value + usrWells(7).Wells_Value
    intWells(5) = usrWells(2).Wells_Value + usrWells(5).Wells_Value + usrWells(8).Wells_Value
    intWells(6) = usrWells(3).Wells_Value + usrWells(6).Wells_Value + usrWells(9).Wells_Value
    intWells(7) = usrWells(1).Wells_Value + usrWells(5).Wells_Value + usrWells(9).Wells_Value
  &

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号