VB.net迷宫代码 迷宫程序代码
求vb.net的源代码,最好说明其解决问题,越多越好,满意加50分。
下面这段代码,是我用来计算每个月存500元进银行,连续30年,最后连本带利能有多少钱。这里面涉及复利计算。界面中右边的文本框用来输出每一次计算的结果。
创新互联-云计算及IDC服务提供商,涵盖公有云、IDC机房租用、绵阳服务器托管、等保安全、私有云建设等企业级互联网基础服务,沟通电话:18980820575
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim nianxian As Integer '年限变量
Dim dingcun As Integer '定存变量
Dim fuli_big As Long '大复利
Dim fuli_small As Long '小复利
Dim i As Integer '循环变量
Dim DATAstring As String '数据字符串
nianxian = Val(年限_TextBox.Text)
dingcun = Val(定存_TextBox.Text)
DATAstring = ""
For i = 1 To nianxian
fuli_small = dingcun * (1 + 0.1875)
dingcun = fuli_small
fuli_big = fuli_big + fuli_small
DATAstring = DATAstring + "[" + Trim(Str(i)) + "]" + Str(fuli_big) + Chr(13) + Chr(10)
'DATAstring = DATAstring + "[" + Trim(Str(i)) + "]" + Str(fuli_small) + Chr(13) + Chr(10)
Next
'fuli_big = fuli_small
TextBox1.Text = DATAstring
结果_TextBox.Text = Str(fuli_big) + "元"
End Sub
跪求vb.net代码
新建窗口,添加picture控件
利用line()方法画线
line(开始x坐标,开始y坐标)-(结束x坐标,结束y坐标),线的颜色,画线的方式(默认为线,B为矩形无填充,BF为填充的矩形)
For i = 1 To 16
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(255, 0, 0)
Picture1.Line (0, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(255, 0, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), 0), RGB(0, 255, 0)
Picture1.Line (Picture1.Width, Picture1.Height / 2)-(i * (Picture1.Width / 16), Picture1.Height), RGB(0, 255, 0)
Next i
如果要在窗口上画也可以调用窗口的line方法即form.line()
求VB.net程序源代码 绘图板、二十一点游戏、计算器、井字棋游戏、屏幕保护程序等
说明:1.共有4个文本框其,其中三个是填入或输出数据的(名称分别是:txta txtb txtc),剩下的那个是符号(txtd)2.共7个按钮,4个是符号按钮,一个计算,一个清零.这是我弄的程序”袖珍计算器”代码也是自己编写的,代码如下:通用声明Dim j As Integer '定义j为整型
Private Sub Text1_Change()End SubPrivate Sub Command1_Click()
txtfuhao.Text = "+" '将”+”显示到文本框txtfuhao.Text中
End SubPrivate Sub Command2_Click()
txtfuhao.Text = "-" ''将”-”显示到文本框txtfuhao.Text中
End SubPrivate Sub Command3_Click()
txtfuhao.Text = "×" '将”×”显示到文本框txtfuhao.Text中
End SubPrivate Sub Command4_Click()
txtfuhao.Text = "÷" 将”÷”'显示到文本框txtfuhao.Text中
End Sub
Private Sub Command5_Click()
Dim a, b, c As Integer
a = Val(txta.Text) '将txta.Text里的内容转化为数值型,然后再赋给a
b = Val(txtb.Text) '将txtb.Text里的内容转化为数值型,然后再赋给b
If txtfuhao.Text = "+" Then '运算过程
c = a + b '运算过程
ElseIf txtfuhao.Text = "-" Then '运算过程
c = a - b '运算过程
ElseIf txtfuhao.Text = "÷" Then '运算过程
c = a / b '运算过程
ElseIf txtfuhao.Text = "×" Then '运算过程
c = a * b '运算过程
Else
j = MsgBox("您输入的符号不正确", vbOKOnly, "错误信息")
End If
txtc.Text = c '将运算结果c输出到文本框txtc中
End SubPrivate Sub Command6_Click()
txta.Text = "" '将空字符输入到文本框内(刷新)
txtb.Text = "" '将空字符输入到文本框内(刷新)
txtc.Text = "" '将空字符输入到文本框内(刷新)
txtfuhao.Text = "" '将空字符输入到文本框内(刷新)
End SubPrivate Sub Command7_Click()
End '结束程序
End SubPrivate Sub Form_Load()End Sub
关于VB中A*寻路算法的提问
定理:穿越于一组互不相交的多边形障碍物S之间、从Pstart通往Pgoal的任何一条最短路径,都是一条多边形路径,其中所有的内部顶点都是S的顶点。
推广:所有最短路径问题。
结论:只有普遍适用的算法,没有普遍适用的代码。
补充:只有问题实例化才能写出适用代码。
你所遇到的可不只是寻路问题,二维寻路相对简单点,我猜测你的问题产生在“碰撞”上,建议你多学习一下“计算几何学”、“计算机图形学”、“机器人运动学”等,当然,编程的基本功也很重要。其实,带有运动的游戏编程是很复杂的。你也可以将你的程序包发给我等我有时间帮你看看。
谁能帮我用VB.net做个简单的游戏设计啊,我快愁死了
这是个vb6的BINGO小游戏的代码 如果要源程序 去我资料里找我网盘的地址 下载bingo.rar
因为没有任何第三方控件,可以直接转成vb.net的!~
Option Explicit
Private iSumA As IntegerPrivate iSumB As Integer
Private Sub Command1_Click()
Dim i As Integer
Dim j As Integer
Call S_Clear(1)
If F_CheckAll = False Then Exit Sub
For j = 0 To 3
For i = 0 To 3
If Val(Text(j).Text) = Val(Label(i).Caption) Then
If i = j Then
iSumA = iSumA + 1
Else
iSumB = iSumB + 1
End If
End If
Next
Next
Call S_Show
End Sub
Private Sub S_Clear(Optional iKB As Integer = 0)
Dim i As Integer
If iKB = 0 Then
For i = 0 To 3
Label(i).Caption = ""
Text(i).Text = ""
Next
End If
iSumA = 0
iSumB = 0
Label5.Caption = ""
End Sub
Private Sub S_Start()
Dim i As Integer
For i = 0 To 3
Label(i).Visible = False
Label(i).Caption = F_iGetRandomize(i)
Next
End Sub
Private Sub S_Show()
Dim stemp As String
Dim i As Integer
For i = 1 To iSumA
stemp = stemp "A"
Next
For i = 1 To iSumB
stemp = stemp "B"
Next
If iSumA + iSumB = 0 Then
Label5.Caption = "0000"
Else
Label5.Caption = stemp
End If
If iSumA = 4 Then
For i = 0 To 3
Label(i).Visible = False
Label(i).Caption = F_iGetRandomize(i)
Next
MsgBox "Bingo", vbOKOnly, "Flying Frog"
Command2.Value = True
DoEvents
Text(0).SetFocus
End If
End Sub
Private Sub Command2_Click()
Call S_Clear
Call S_Start
End Sub
Private Sub Form_Load()
Call S_Clear
Call S_Start
End Sub
Private Function F_iGetRandomize(ByVal iKB As Integer) As Integer
Dim num As Integer
Start:
Randomize
num = Rnd * (9 - 1) + 1
Select Case iKB
Case 0
F_iGetRandomize = num
Case 1
If num Val(Label(0).Caption) And _
num Val(Label(2).Caption) And _
num Val(Label(3).Caption) Then
F_iGetRandomize = num
Else
GoTo Start
End If
Case 2
If num Val(Label(0).Caption) And _
num Val(Label(2).Caption) And _
num Val(Label(3).Caption) Then
F_iGetRandomize = num
Else
GoTo Start
End If
Case 3
If num Val(Label(0).Caption) And _
num Val(Label(1).Caption) And _
num Val(Label(2).Caption) Then
F_iGetRandomize = num
Else
GoTo Start
End If
End Select
End Function
Private Function F_CheckText(ByVal iIndex As Integer) As Boolean
F_CheckText = False
If Val(Text(iIndex).Text) = 0 Then
Text(iIndex).SetFocus
MsgBox "Must Input", vbCritical, "Flying Frog"
Exit Function
End If
Select Case iIndex
Case 0
If Val(Text(iIndex).Text) = Val(Text(1).Text) Or _
Val(Text(iIndex).Text) = Val(Text(2).Text) Or _
Val(Text(iIndex).Text) = Val(Text(3).Text) Then
Text(iIndex).SetFocus
MsgBox "Same Number", vbCritical, "Flying Frog"
Exit Function
End If
Case 1
If Val(Text(iIndex).Text) = Val(Text(0).Text) Or _
Val(Text(iIndex).Text) = Val(Text(2).Text) Or _
Val(Text(iIndex).Text) = Val(Text(3).Text) Then
Text(iIndex).SetFocus
MsgBox "Same Number", vbCritical, "Flying Frog"
Exit Function
End If
Case 2
If Val(Text(iIndex).Text) = Val(Text(0).Text) Or _
Val(Text(iIndex).Text) = Val(Text(1).Text) Or _
Val(Text(iIndex).Text) = Val(Text(3).Text) Then
Text(iIndex).SetFocus
MsgBox "Same Number", vbCritical, "Flying Frog"
Exit Function
End If
Case 3
If Val(Text(iIndex).Text) = Val(Text(0).Text) Or _
Val(Text(iIndex).Text) = Val(Text(1).Text) Or _
Val(Text(iIndex).Text) = Val(Text(2).Text) Then
Text(iIndex).SetFocus
MsgBox "Same Number", vbCritical, "Flying Frog"
Exit Function
End If
End Select
F_CheckText = True
End Function
Private Function F_CheckAll() As Boolean
Dim i As Integer
F_CheckAll = False
For i = 0 To 3
If F_CheckText(i) = False Then Exit Function
Next
F_CheckAll = True
End Function
Private Sub Text_GotFocus(Index As Integer)
Text(Index).SelStart = 0
Text(Index).SelLength = Len(Text(Index).Text)
End Sub
Private Sub Text_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If F_CheckText(Index) = False Then Exit Sub
End If
S_gKeySend (KeyCode)
End Sub
Private Sub Text_KeyPress(Index As Integer, KeyAscii As Integer)
KeyAscii = F_gKeypressNumber(Text(Index), KeyAscii, 1)
End Sub
当前名称:VB.net迷宫代码 迷宫程序代码
标题网址:http://myzitong.com/article/dodggpo.html