扫雷程序“布雷”代码(vb)

神风宠儿

神风宠儿

2016-01-29 13:08

扫雷程序“布雷”代码(vb),扫雷程序“布雷”代码(vb)

dim a(10,10),b(100) as longFor i = 1 To 10 For j = 1 To 10 a(i, j) = "0" Next jNext iFor k = 1 To 20 '²¼À×10: a1 = Int(Rnd * 10) + 1 b1 = Int(Rnd * 10) + 1 If a(a1, b1) = "0" Then a(a1, b1) = "*" n = n + 1 Else GoTo 10 End IfNext k'ÉèÖÃÀ×±ßÉϵÄÊý×ÖFor n = 2 To 9 'ÖмäÅÐ¶Ï For t = 2 To 9 If a(n, t) = "*" Then For n1 = n - 1 To n + 1 For t1 = t - 1 To t + 1 If a(n1, t1) <> "*" Then a(n1, t1) = LTrim$(Str$(Val(a(n1, t1)) + 1)) End If Next t1 Next n1 End If Next tNext nFor i = 2 To 9 If a(1, i) = "*" Then 'µÚÒ»ÐÐÅÐ¶Ï For j = 1 To 2 For k = i - 1 To i + 1 If a(j, k) <> "*" Then a(j, k) = LTrim$(Str$(Val(a(j, k)) + 1)) End If Next k Next j End If If a(10, i) = "*" Then 'µÚÊ®ÐÐÅÐ¶Ï For j = 9 To 10 For k = i - 1 To i + 1 If a(j, k) <> "*" Then a(j, k) = LTrim$(Str$(Val(a(j, k)) + 1)) End If Next k Next j End IfNext iFor i = 2 To 9 If a(i, 1) = "*" Then 'µÚÒ»ÐУ¬µÚiÁÐÅÐ¶Ï For j = i - 1 To i + 1 For k = 1 To 2 If a(j, k) <> "*" Then a(j, k) = LTrim$(Str$(Val(a(j, k)) + 1)) End If Next k Next j End If If a(i, 10) = "*" Then 'µÚiÐУ¬µÚÊ®ÁÐÅÐ¶Ï For j = i - 1 To i + 1 For k = 9 To 10 If a(j, k) <> "*" Then a(j, k) = LTrim$(Str$(Val(a(j, k)) + 1)) End If Next k Next j End IfNext i'Ëĸö½ÇÅжÏIf a(1, 1) = "*" Then 'µÚ1ÐУ¬µÚ1ÁÐÀ×ÅÐ¶Ï For i = 1 To 2 For j = 1 To 2 If a(i, j) <> "*" Then a(i, j) = LTrim$(Str$(Val(a(i, j)) + 1)) End If Next j Next iEnd IfIf a(1, 10) = "*" Then 'µÚ1ÐУ¬µÚ10ÁÐÀ×ÅÐ¶Ï For i = 1 To 2 For j = 9 To 10 If a(i, j) <> "*" Then a(i, j) = LTrim$(Str$(Val(a(i, j)) + 1)) End If Next j Next iEnd IfIf a(10, 1) = "*" Then 'µÚ10ÐУ¬µÚ1ÁÐÀ×ÅÐ¶Ï For i = 9 To 10 For j = 1 To 2 If a(i, j) <> "*" Then a(i, j) = LTrim$(Str$(Val(a(i, j)) + 1)) End If Next j Next iEnd IfIf a(10, 10) = "*" Then 'µÚ10ÐУ¬µÚ10ÁÐÀ×ÅÐ¶Ï For i = 9 To 10 For j = 9 To 10 If a(i, j) <> "*" Then a(i, j) = LTrim$(Str$(Val(a(i, j)) + 1)) End If Next j Next iEnd IfFor i = 1 To 100 b(i) = a((i - 1) 10 + 1, (i - 1) Mod 10 + 1)Next i布雷为:10*10型
展开更多 50%)
分享

猜你喜欢

扫雷程序“布雷”代码(vb)

电脑网络
扫雷程序“布雷”代码(vb)

优化之路:精简VB程序的代码

vb
优化之路:精简VB程序的代码

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

C# Mines(布雷) 代码

编程语言 网络编程
C# Mines(布雷) 代码

为你的VB程序程序加密(VB新手)

编程语言 网络编程
为你的VB程序程序加密(VB新手)

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

用VB编写抽奖程序

编程语言 网络编程
用VB编写抽奖程序

用VB编写托盘程序

编程语言 网络编程
用VB编写托盘程序

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

[收藏]ASP.Net生成静态HTML页 选择自 coofucoo 的 Blog

[收藏]ASP.Net生成静态HTML页 选择自 coofucoo 的 Blog

调用另外一个同名的重载函数漏掉括号出现的严重问题

调用另外一个同名的重载函数漏掉括号出现的严重问题
下拉加载更多内容 ↓