没有合适的资源?快使用搜索试试~ 我知道了~
用vb源代码编写的井子棋
需积分: 16 13 下载量 54 浏览量
2009-05-12
23:17:01
上传
评论
收藏 5KB TXT 举报
温馨提示
试读
8页
在窗体上添加: ChessBoard - PictureBox,AutoRedraw=true,width=3000,height=3000,Enabled=false Command1 - Button,Caption="开战" Command2 - Button,Caption="退出" 'White By RichTextBox (张力-广西百色市) Option Explicit Option Base 1 Dim cx As Long, cy As Long Dim ch(3, 3) As Integer Dim sco(3, 3) As Integer 'White By RichTextBox (张力-广西百色市) Private Sub Command2_Click() End
资源推荐
资源详情
资源评论
在窗体上添加:
ChessBoard - PictureBox,AutoRedraw=true,width=3000,height=3000,Enabled=false
Command1 - Button,Caption="开战"
Command2 - Button,Caption="退出"
'White By RichTextBox (张力-广西百色市)
Option Explicit
Option Base 1
Dim cx As Long, cy As Long
Dim ch(3, 3) As Integer
Dim sco(3, 3) As Integer
'White By RichTextBox (张力-广西百色市)
Private Sub Command2_Click()
End
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub Form_Load()
sco(1, 1) = 2: sco(1, 2) = 1: sco(1, 3) = 2
sco(2, 1) = 1: sco(2, 2) = 3: sco(2, 3) = 1
sco(3, 1) = 2: sco(3, 2) = 1: sco(3, 3) = 2
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub ChessBoard_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button <> 1 Then Exit Sub
If IsEnded Then
MsgBox "和棋了!", vbInformation, "提示"
ReInit
Exit Sub
End If
cx = Int((x + 1000) / 1000)
cy = Int((y + 1000) / 1000)
ChessBoard - PictureBox,AutoRedraw=true,width=3000,height=3000,Enabled=false
Command1 - Button,Caption="开战"
Command2 - Button,Caption="退出"
'White By RichTextBox (张力-广西百色市)
Option Explicit
Option Base 1
Dim cx As Long, cy As Long
Dim ch(3, 3) As Integer
Dim sco(3, 3) As Integer
'White By RichTextBox (张力-广西百色市)
Private Sub Command2_Click()
End
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub Form_Load()
sco(1, 1) = 2: sco(1, 2) = 1: sco(1, 3) = 2
sco(2, 1) = 1: sco(2, 2) = 3: sco(2, 3) = 1
sco(3, 1) = 2: sco(3, 2) = 1: sco(3, 3) = 2
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub ChessBoard_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button <> 1 Then Exit Sub
If IsEnded Then
MsgBox "和棋了!", vbInformation, "提示"
ReInit
Exit Sub
End If
cx = Int((x + 1000) / 1000)
cy = Int((y + 1000) / 1000)
If ch(cx, cy) <> 0 Then Exit Sub
DrawChess cx, cy, False
ch(cx, cy) = 1
Compute
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub command1_Click()
ChessBoard.Enabled = True
command1.Enabled = False
DrawChessBoard
If MsgBox("你要先行吗?", vbInformation + vbYesNo, "提示") = vbNo Then
Compute
End If
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub DrawChessBoard()
Dim x As Long, y As Long
ChessBoard.Cls
For x = 1000 To 3000 Step 1000
For y = 1000 To 3000 Step 1000
ChessBoard.Line (x, 0)-(x, y)
ChessBoard.Line (0, y)-(x, y)
Next
Next
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub DrawChess(ByVal x As Long, ByVal y As Long, ByVal who As Boolean)
If who = 0 Then ChessBoard.FillColor = vbBlue Else ChessBoard.FillColor = vbRed
ch(x, y) = True
x = x - 1: y = y - 1
DrawChess cx, cy, False
ch(cx, cy) = 1
Compute
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub command1_Click()
ChessBoard.Enabled = True
command1.Enabled = False
DrawChessBoard
If MsgBox("你要先行吗?", vbInformation + vbYesNo, "提示") = vbNo Then
Compute
End If
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub DrawChessBoard()
Dim x As Long, y As Long
ChessBoard.Cls
For x = 1000 To 3000 Step 1000
For y = 1000 To 3000 Step 1000
ChessBoard.Line (x, 0)-(x, y)
ChessBoard.Line (0, y)-(x, y)
Next
Next
End Sub
'White By RichTextBox (张力-广西百色市)
Private Sub DrawChess(ByVal x As Long, ByVal y As Long, ByVal who As Boolean)
If who = 0 Then ChessBoard.FillColor = vbBlue Else ChessBoard.FillColor = vbRed
ch(x, y) = True
x = x - 1: y = y - 1
剩余7页未读,继续阅读
资源评论
weiweiweini87
- 粉丝: 0
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功