Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


programming thesis VB.net


programming thesis VB.net

Author
Message
enzomatrix
enzomatrix
Forum God
Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)

Group: Forum Members
Posts: 2, Visits: 14
dear friends,



I would like to ask some help. I am a beginner in vb.net programming and right now we have a thesis in school to develop an Application of Programming to Chemistry Dama. I already have a sample codes that I attached.



The problem that I have right now is how can I capture 2 or 3 chips in one move. The code that I have is for capturing 1 chip per move. Need some help to have some idea on how I can modify my codes.



Thank you



sample code that I have in my program



'-----single chip taken-----------------'chip 9

If picCheckers9.Location = square17 And picCheckers13.Location.X > 307 And picCheckers13.Location.Y > 189 And Open14 = True And Open17 = False Then

picCheckers13.Location = square14

str13 = 14

Open17 = True

Open14 = False

Open21 = True

picCheckers9.Location = square40

lblTurn.Text = "Red"

'TextBox1.Text &= Environment.NewLine + "Al 4,3 Al ------ -- -62"

DataGridView1.Rows.Add(New Object() {"Al", "3,4", "Al", "AlAl", "-54"})



'----extra for double taken chips----- chip 9

ElseIf picCheckers9.Location = square17 And picCheckers1.Location = square9 Or picCheckers2.Location = square9 Or picCheckers5.Location = square9 Or picCheckers6.Location = square9 And picCheckers13.Location.X > 307 And picCheckers13.Location.Y > 189 And Open14 = True And Open17 = False And Open9 = False And Open5 = True Then

picCheckers13.Location = square14

str13 = 14

Open17 = True

Open14 = False

Open21 = True

picCheckers9.Location = square40

'lblTurn.Text = "Red"

'TextBox1.Text &= Environment.NewLine + "Al 4,3 Al ------ -- -62"

DataGridView1.Rows.Add(New Object() {"Al", "3,4", "Al", "AlAl", "-54"})

'----extra for double taken chips-----



'Else

'lblTurn.Text = "Red"

Attachments
thesis.rar (565 views, 1.00 MB)
zack
zack
Forum God
Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)

Group: Forum Members
Posts: 102, Visits: 110
If I understand correctly, you'd like to do a double capture by moving from say square A to square C without landing on square B after the first capture?
enzomatrix
enzomatrix
Forum God
Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)Forum God (622 reputation)

Group: Forum Members
Posts: 2, Visits: 14
yes, I would like to add a double capture
zack
zack
Forum God
Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)Forum God (25K reputation)

Group: Forum Members
Posts: 102, Visits: 110
How about using a nested if statement to test for a second capture? After your first IF statement, ie.



If picCheckers9.Location = square17 And picCheckers13.Location.X > 307 And picCheckers13.Location.Y > 189 And Open14 = True And Open17 = False Then

If ....... Then



use a second nested IF statement to test for a possible second capture without actually moving your chip after the first capture is confirmed. That is, do not set picCheckers9.Location = square40 until after the second IF statement tests for a possible second capture. If the second IF condition is true then you can move to the second capture position, otherwise if the condition fails move only to the first capture position, ie. picCheckers9.Location = square40



Edited
12/3/2012 by zack
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search