這是一個很深奧的問題,你可以問 趙鑫鑫 還有 王天一
2. 求VB編寫中國象棋的源代碼。急求。必有重謝
貼保存棋局和讀取棋局部分的,你先看看:
Rem 讀取棋局
Private Sub mnuRead_Click()
Dim s As String, i As Integer, t
If Dir(App.Path & "\cchess.che") = "" Then MsgBox "沒有棋局文件可以讀入!請先保存棋局!", , "中國象棋": Exit Sub
Open App.Path & "\cchess.che" For Input As #1
Input #1, s
Close #1
s = Replace(s, vbCrLf, "")
s = Trim(s)
t = Split(s, " ")
If UBound(t) <> 89 Then MsgBox "棋局文件已遭到破壞!請重新保存棋局!", , "中國象棋": Exit Sub
For i = 0 To 89
a(i) = Val(t(i))
Next
MsgBox "棋局文件已成功讀入!", , "中國象棋"
End Sub
Rem 保存棋局
Private Sub mnuSave_Click()
Dim s As String, i As Integer
s = ""
For i = 0 To 89
s = s & " " & a(i)
Next
s = Trim(s)
Open App.Path & "\cchess.che" For Output As #1
Print #1, s;
Close #1
MsgBox "當前棋局已成功保存!", , "中國象棋"
End Sub