Breaking the Kubernetes Kill Chain: Host Path Mount
Vb decompilador
1. Decompildadores
VB.Net to C# Converter Download
VB.Net to C# Converter es un conversor de código VB a C #. Todas las versiones de
Visual Basic.Net son compatibles: 2003, 2005, 2008, 2010, 2012, así como todos los
tipos de proyectos (Win Forms, Web, Biblioteca de clases, Compact Framework,
Silverlight, etc.)
Posee soporte para las últimas características del lenguaje VB.Net, incluyendo
await/async VB2012, VB2010 mejoras como continuación de línea implícita y mucho más.
Características principales del programa VB.Net to C# Converter:
Soporte para las últimas características de Visual Studio. Los últimos
características VB.Net/C# son soportados, incluyendo métodos Await/Async,
Continuación implícita de línea, Lambdas multilínea, los parámetros opcionales
que aceptan valores NULL, LINQ, XML, WPF, expresiones lambda y extensión.
Soporte para todos los tipos de proyectos. Formas Win, Web, Biblioteca de
clases, Compact Framework, consola, etc.
Alta precisión. Probados en cientos de proyectos de Microsoft (Visual Studio
ejemplos del SDK, proyectos SDK DirectX, Windows 7 muestras de SDK, etc.) y
mucho más.
Facilidad de uso. Mientras que la lógica de conversión en sí es compleja,
usando el convertidor no lo es. Usted es guiado a través de cada paso del
proceso con fáciles y claras instrucciones.
Personalización. No todos los proyectos son iguales. Con docenas de opciones
de conversión para elegir, usted tiene el control del proceso de conversión.
Convertir proyectos individuales o grupos de proyectos. Se pueden crear listas
de programas y convertirlos con un solo clic. También hay una versión de línea
de comandos incluida.
Informes completos. Hay informes que muestran los potenciales focos de
conflicto en el código, cosas interesantes que ocurrieron durante el proceso
de conversión, y que errores de compilación de C # deben ser corregidos.
Vb Decompiler lite v7.8.
Es descompilador para programas (EXE, DLL o OCX) escritos en Visual Basic 5.0 y 6.0 y
desensamblador para programas escritos en. NET. Como usted sabe, los programas en
Visual Basic puede compilar en p-code interpretado o en código nativo. . NET
ensamblado compilado para siempre sólo en el código IL tiempo compilable. Como p-
código consta de comandos de alto nivel, hay una posibilidad real de descompilarlo en
el código fuente (por supuesto, los nombres de las variables y algunas funciones no
se descompilado). VB Decompiler restaura el código fuente de p-código tanto como sea
posible con precisión. Y después de algunas modificaciones que pueden tratar de
compilar el código generado. Si un programa fue compilado en el código nativo,
restaurando el código fuente completo de instrucciones de la máquina no es posible.
Pero VB Decompiler puede ayudar a analizar el programa incluso en esta situación
también. Contiene un desensamblador de gran alcance y emulador. Este motor potente
tratar de descifrar la mayoría de las instrucciones de ensamblador para la mayoría de
los posibles comandos de VB.
7. Codigo fuente aplicación
Programa sencillo de ajedrez creadon en visual basic
main.frm
VERSION 5.00
Begin VB.Form main
Caption = "Chess"
ClientHeight = 7260
ClientLeft = 4770
ClientTop = 1980
ClientWidth = 9450
LinkTopic = "Form1"
ScaleHeight = 7260
ScaleWidth = 9450
Begin VB.Timer Timer
Enabled = 0 'False
Interval = 1000
Left = 8880
Top = 3240
End
Begin VB.Label lblTime2
Caption = "Black Time Remaining:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7200
TabIndex = 7
Top = 120
Width = 2175
End
Begin VB.Label lblTime
Caption = "White Time Remaining:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7200
TabIndex = 6
Top = 5640
Width = 2175
End
8. Begin VB.Label WTimeShow
BeginProperty Font
Name = "MS Sans Serif"
Size = 29.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 7200
TabIndex = 5
Top = 6000
Width = 2055
End
Begin VB.Label BTimeShow
BeginProperty Font
Name = "MS Sans Serif"
Size = 29.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 7200
TabIndex = 4
Top = 360
Width = 2055
End
Begin VB.Label PlayerTurn
Caption = "Players Turn:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7080
TabIndex = 3
Top = 3240
Width = 1455
End
Begin VB.Label lblPiece
Caption = "Piece Selected:"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
9. Weight = 400
Underline = -1 'True
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 7080
TabIndex = 2
Top = 2400
Width = 1695
End
Begin VB.Label PieceSelectedANS
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 7080
TabIndex = 1
Top = 2640
Width = 1455
End
Begin VB.Image BoardTop
Height = 855
Index = 0
Left = 240
Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 1
Left = 1080
Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 2
Left = 1920
Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 3
Left = 2760
10. Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 4
Left = 3600
Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 5
Left = 4440
Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 6
Left = 5280
Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 7
Left = 6120
Stretch = -1 'True
Top = 120
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 8
Left = 240
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 9
Left = 1080
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 10
11. Left = 1920
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 11
Left = 2760
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 12
Left = 3600
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 13
Left = 4440
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 14
Left = 5280
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 15
Left = 6120
Stretch = -1 'True
Top = 960
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 16
Left = 240
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
Height = 855
12. Index = 17
Left = 1080
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 18
Left = 1920
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 19
Left = 2760
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 20
Left = 3600
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 21
Left = 4440
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 22
Left = 5280
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 23
Left = 6120
Stretch = -1 'True
Top = 1800
Width = 855
End
Begin VB.Image BoardTop
13. Height = 855
Index = 24
Left = 240
Stretch = -1 'True
Top = 2640
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 25
Left = 1080
Stretch = -1 'True
Top = 2640
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 26
Left = 1920
Stretch = -1 'True
Top = 2640
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 27
Left = 2760
Stretch = -1 'True
Top = 2640
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 28
Left = 3600
Stretch = -1 'True
Top = 2640
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 29
Left = 4440
Stretch = -1 'True
Top = 2640
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 30
Left = 5280
Stretch = -1 'True
Top = 2640
Width = 855
End
14. Begin VB.Image BoardTop
Height = 855
Index = 31
Left = 6120
Stretch = -1 'True
Top = 2640
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 32
Left = 240
Stretch = -1 'True
Top = 3480
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 33
Left = 1080
Stretch = -1 'True
Top = 3480
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 34
Left = 1920
Stretch = -1 'True
Top = 3480
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 35
Left = 2760
Stretch = -1 'True
Top = 3480
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 36
Left = 3600
Stretch = -1 'True
Top = 3480
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 37
Left = 4440
Stretch = -1 'True
Top = 3480
Width = 855
15. End
Begin VB.Image BoardTop
Height = 855
Index = 38
Left = 5280
Stretch = -1 'True
Top = 3480
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 39
Left = 6120
Stretch = -1 'True
Top = 3480
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 40
Left = 240
Stretch = -1 'True
Top = 4320
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 41
Left = 1080
Stretch = -1 'True
Top = 4320
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 42
Left = 1920
Stretch = -1 'True
Top = 4320
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 43
Left = 2760
Stretch = -1 'True
Top = 4320
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 44
Left = 3600
Stretch = -1 'True
Top = 4320
16. Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 45
Left = 4440
Stretch = -1 'True
Top = 4320
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 46
Left = 5280
Stretch = -1 'True
Top = 4320
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 47
Left = 6120
Stretch = -1 'True
Top = 4320
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 48
Left = 240
Stretch = -1 'True
Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 49
Left = 1080
Stretch = -1 'True
Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 50
Left = 1920
Stretch = -1 'True
Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 51
Left = 2760
Stretch = -1 'True
17. Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 52
Left = 3600
Stretch = -1 'True
Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 53
Left = 4440
Stretch = -1 'True
Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 54
Left = 5280
Stretch = -1 'True
Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 55
Left = 6120
Stretch = -1 'True
Top = 5160
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 56
Left = 240
Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 57
Left = 1080
Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 58
Left = 1920
18. Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 59
Left = 2760
Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 60
Left = 3600
Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 61
Left = 4440
Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 62
Left = 5280
Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Image BoardTop
Height = 855
Index = 63
Left = 6120
Stretch = -1 'True
Top = 6000
Width = 855
End
Begin VB.Label PlayerTurnANS
Caption = "White"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
19. Height = 375
Left = 7080
TabIndex = 0
Top = 3480
Width = 1335
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu cmdUnselect
Caption = "Unselect Piece"
Shortcut = ^U
End
Begin VB.Menu cmdHelp
Caption = "Help"
End
Begin VB.Menu fb2
Caption = "-"
End
Begin VB.Menu cmdSave
Caption = "Save Game"
End
Begin VB.Menu cmdLoadGame
Caption = "Load Game"
End
Begin VB.Menu fb3
Caption = "-"
End
Begin VB.Menu cmdAbout
Caption = "&About"
End
Begin VB.Menu fb1
Caption = "-"
End
Begin VB.Menu cmdQuit
Caption = "Quit"
End
End
End
Attribute VB_Name = "main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Brian Thomasch
'SimpleChess VB
'-----------------------
Option Explicit
' 0 = White
'0 R K B Q K B K R
'8 P P P P P P P P
'16 x x x x x x x x
'24 x x x x x x x x
20. '32 x x x x x x x x
'40 x x x x x x x x
'48 P P P P P P P P
'56 R K B K Q B K R
Private Sub cmdAbout_Click()
Load frmAbout
frmAbout.Show 1
End Sub
Private Sub cmdHelp_Click()
Load frmAbout
frmHelp.Show 1
End Sub
Sub Form_Load()
Dim Temp%
Dim Count%
Player = 1 'Player 1 = Whites Turn
BoardColorSetup 'Colors the board (Black and white spaces), before pieces are put in)
'---------Black Piece Setup-----------
BoardTop(0).Picture = LoadPicture("WBlackRook.bmp")
BoardTopPiece(0) = "BlackRook"
BoardTop(1).Picture = LoadPicture("BBlackKnight.bmp")
BoardTopPiece(1) = "BlackKnight"
BoardTop(2).Picture = LoadPicture("WBlackBishop.bmp")
BoardTopPiece(2) = "BlackBishop"
BoardTop(3).Picture = LoadPicture("BBlackQueen.bmp")
BoardTopPiece(3) = "BlackQueen"
BoardTop(4).Picture = LoadPicture("WBlackKing.bmp")
BoardTopPiece(4) = "BlackKing"
BoardTop(5).Picture = LoadPicture("BBlackBishop.bmp")
BoardTopPiece(5) = "BlackBishop"
BoardTop(6).Picture = LoadPicture("WBlackKnight.bmp")
BoardTopPiece(6) = "BlackKnight"
BoardTop(7).Picture = LoadPicture("BBlackRook.bmp")
BoardTopPiece(7) = "BlackRook"
'---------White Piece Setup-----------
BoardTop(56).Picture = LoadPicture("BWhiteRook.bmp")
BoardTopPiece(56) = "WhiteRook"
BoardTop(57).Picture = LoadPicture("WWhiteKnight.bmp")
BoardTopPiece(57) = "WhiteKnight"
BoardTop(58).Picture = LoadPicture("BWhiteBishop.bmp")
BoardTopPiece(58) = "WhiteBishop"
BoardTop(59).Picture = LoadPicture("WWhiteQueen.bmp")
BoardTopPiece(59) = "WhiteQueen"
BoardTop(60).Picture = LoadPicture("BWhiteKing.bmp")
BoardTopPiece(60) = "WhiteKing"
BoardTop(61).Picture = LoadPicture("WWhiteBishop.bmp")
BoardTopPiece(61) = "WhiteBishop"
BoardTop(62).Picture = LoadPicture("BWhiteKnight.bmp")
21. BoardTopPiece(62) = "WhiteKnight"
BoardTop(63).Picture = LoadPicture("WWhiteRook.bmp")
BoardTopPiece(63) = "WhiteRook"
'--------White & Black Pawn Setup---------
Temp = 8
For Count = 1 To 4
BoardTop(Temp).Picture = LoadPicture("BBlackPawn.bmp")
BoardTopPiece(Temp) = "BlackPawn"
BoardTop(Temp + 1).Picture = LoadPicture("WBlackPawn.bmp")
BoardTopPiece(Temp + 1) = "BlackPawn"
BoardTop(Temp + 40).Picture = LoadPicture("WWhitePawn.bmp")
BoardTopPiece(Temp + 40) = "WhitePawn"
BoardTop(Temp + 41).Picture = LoadPicture("BWhitePawn.bmp")
BoardTopPiece(Temp + 41) = "WhitePawn"
Temp = Temp + 2
Next
'----Asks User if Game Should be Timed-------
Load frmClock
frmClock.Show 1
If Timed = True Then
TimedStart
Else:
WTimeShow.Visible = False
BTimeShow.Visible = False
lblTime.Visible = False
lblTime2.Visible = False
End If
End Sub
Public Function BoardColorSetup()
'--------------
Dim Temp%, Count%
For Count = 0 To 3
Call WhiteFirst(Temp)
Call BlackFirst(Temp)
Next Count
End Function
Sub WhiteFirst(Temp As Integer)
Dim Count2%
For Count2 = 0 To 3
BoardTop(Temp).Picture = LoadPicture("EmptyWhite.bmp")
BlackWhiteSpaces(Temp) = "White"
Temp = Temp + 1
BoardTop(Temp).Picture = LoadPicture("EmptyBlack.bmp")
BlackWhiteSpaces(Temp) = "Black"
Temp = Temp + 1
Next
End Sub
Sub BlackFirst(Temp As Integer)
Dim Count2%
22. For Count2 = 0 To 3
BoardTop(Temp).Picture = LoadPicture("EmptyBlack.bmp")
BlackWhiteSpaces(Temp) = "Black"
Temp = Temp + 1
BoardTop(Temp).Picture = LoadPicture("EmptyWhite.bmp")
BlackWhiteSpaces(Temp) = "White"
Temp = Temp + 1
Next
End Sub
'-------------------------------
'-------Piece Movement----------
'-------------------------------
Public Sub BoardTop_Click(Index As Integer)
If Selection = 0 Then
IndexSelected = Index
Selection = 1 'Selection Variable Determines Weather Click selects
or moves a piece
PieceSelectedANS.Caption = BoardTopPiece(IndexSelected)
Else
IndexForMove = Index
PieceMoveMain
If Valid = True Then
Selection = 0
PieceSelectedANS.Caption = ""
End If
End If
Row = ((IndexSelected / 8) - 0.499) + 1 'Finds row selected (for use in pawn
double moves)
End Sub
Private Sub cmdUnselect_Click()
Selection = 0
PieceSelectedANS.Caption = ""
MsgBox (BoardTopPiece(IndexSelected) & Space(1) & "unselected. Choose New
Piece")
End Sub
Private Sub cmdQuit_Click()
Unload main
End Sub
Private Sub Timer_Timer()
If Player = 1 Then
WTime = WTime - 1
Else:
BTime = BTime - 1
End If
TimeDisplay
End Sub
Private Sub cmdSave_Click()
Save
End Sub
23. PieceMovement.bas
Attribute VB_Name = "PieceMovement"
Option Explicit
'--------------------------------
'--------Piece Movement----------
'--------------------------------
Public Function PieceMoveMain()
Dim StrVar1 As String
Dim StrVarFin As String
ValidityCheck 'Summons the all knowing Validity Function, whichs deciedes weather to
let you
'make that move or not.
Compare 'Checks to see if Validity is true or false
If Valid = True Then GoTo Valid
If Valid = False And Continue = True Then
MsgBox ("Thats not a legal move." & vbCrLf & "Learn how to play chess!")
GoTo End2
Else
GoTo End2
End If
'----------------
'----If Valid----
'----------------
Valid:
StrVar1 = Left(BlackWhiteSpaces(IndexForMove), 1)
Piece = BoardTopPiece(IndexSelected)
StrVarFin = StrVar1 & Piece & ".bmp"
MoveIt (StrVarFin)
If BlackWhiteSpaces(IndexSelected) = "White" Then
main.BoardTop(IndexSelected).Picture = LoadPicture("EmptyWhite.bmp")
Else
main.BoardTop(IndexSelected).Picture = LoadPicture("EmptyBlack.bmp")
End If
'--------Switches Players----------
If Player = 1 Then
Player = 2
main.PlayerTurnANS.Caption = "Black"
Else: Player = 1
main.PlayerTurnANS.Caption = "White"
End If
'----------------------------------
IndexForMove = -1
24. IndexSelected = -1
TempMoveNum = 0
End2:
'------Clears ValidMoves Array------
Dim TempCount As Integer
Dim TempA As Integer
For TempCount = 0 To 63
ValidMoves(TempA) = -1 'There is no -1 index on the board
TempA = TempA + 1
Next
'-----------------------------------
End Function
Public Function MoveIt(StrVarFin As String)
main.BoardTop(IndexForMove).Picture = LoadPicture(StrVarFin)
BoardTopPiece(IndexForMove) = BoardTopPiece(IndexSelected)
BoardTopPiece(IndexSelected) = ""
End Function
Public Function Compare()
Dim Count As Integer
Dim Temp As Integer
For Count = 0 To 63
If IndexForMove = ValidMoves(Temp) Then
Valid = True
GoTo End1
Else: Valid = False
Temp = Temp + 1
End If
Next
End1:
End Function
Playerturn.bas
Attribute VB_Name = "PlayerTurn"
'Brian Thomasch
'--------------
'This module contains 2 functions that check to make sure the right person is going.
Public Function WhiteTurnCheck()
If Player = 2 Then
Continue = False
Valid = False
MsgBox ("Its Black's Turn!")
main.PieceSelectedANS.Caption = "" 'Clears pieceselected box
Selection = 0 'Makes it so player can reselect piece
Else: Continue = True
End If
End Function
25. Public Function BlackTurnCheck()
If Player = 1 Then
Continue = False
Valid = False
MsgBox ("It is White's Turn!")
main.PieceSelectedANS.Caption = "" 'clears pieceselected box
Selection = 0 'Makes it so player can reselect piece
Else: Continue = True
End If
End Function
PublicVariables.bas
Attribute VB_Name = "PublicVariables"
'Brian Thomasch
'--------------
'-------------------Public Variables------------------
Public Timed As Boolean
'Timed or not
Public TimeAmmount As Integer 'Minutes
Public WTime As Integer 'Seconds
Public BTime As Integer 'Seconds
Public BoardTopPiece(-30 To 93) As String
'Contains WhiteX BlackX, and "" for non used spaces
'was origionaly 0 to 63, but i expanded the UBound and LBound by 30 so "Substring Out
of Range"
'errors wouldnt occur when creating the validmoves array. its the quick and dirty
way to do it
'but it does its job.
Public ValidMoves(63) As Integer
'Contains list of indexs that would be valid moves for each
'different piece selection
Public BlackWhiteSpaces(63) As String
'Doesnt Change. Holds "Black" or "White" for each space on
'the board.
Public IndexSelected As Integer
'Index Selected to move
Public IndexForMove As Integer
'The index the user wants to move IndexSelected to
Public PColor As String, BColor As String, Piece As String
'Characteristics for the space for the MoveIt function
Public Valid As Boolean
'Holds weather a move is legal or not.
26. Public Player As Integer
'Holds 1 for White's Turn
'Holds 2 for Black's Turn
Public Selection As Integer
'Holds either 1 or 2 so clicks either
'move or select a piece
Public TempMoveNum As Integer
'Holds number for index for assignment to ValidMoves Array
Public Continue As Boolean
'Boolean variable for weather the right player is going
Public PawnCount(15) As Integer
'Holds counter for each pawn, so if counter = 0 (the pawn hasnt moved) it may move
two spaces
Public TempMoveSpaces As Integer
Public Row As Integer
'self explanitory. thank you.
Public Queen As Boolean
'Holds weather Queen is selected or not, for the queen function
Public TempVM As Integer
'Like TempMoveNum
SaveGame.bas
Attribute VB_Name = "SaveGame"
'Brian Thomasch
'---------------
Public Function Save()
Dim Temp As Integer, Count As Integer
Dim intFileNum As Integer
intFileNum = FreeFile
Open "SaveGame.txt" For Output As #intFileNum
'For Count = 0 To 63
Print #intFileNum, BoardTopPiece(Temp)
'Temp = Temp + 1
'Next
End Function
27. SpotCheker.bas
Attribute VB_Name = "SpotChecker"
'Brian Thomasch
'--------------
'This public function serves the purpose of checking to make sure that while a piece
taking the other players
'piece is valid, a move that would result in taking your own piece is invalid.
'This is uses for Pawn, Knight, and
Public Function SpotChecker4White(TempMoveSpaces As Integer)
If BoardTopPiece(IndexSelected + TempMoveSpaces) = "" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "BlackPawn" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "BlackBishop" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "BlackKnight" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "BlackRook" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "BlackKing" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "BlackQueen" Then
ValidMoves(TempMoveNum) = IndexSelected + TempMoveSpaces
TempMoveNum = TempMoveNum + 1
End If
End Function
Public Function SpotChecker4Black(TempMoveSpaces As Integer)
If BoardTopPiece(IndexSelected + TempMoveSpaces) = "" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "WhitePawn" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "WhiteBishop" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "WhiteKnight" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "WhiteRook" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "WhiteKing" Or _
BoardTopPiece(IndexSelected + TempMoveSpaces) = "WhiteQueen" Then
ValidMoves(TempMoveNum) = IndexSelected + TempMoveSpaces
TempMoveNum = TempMoveNum + 1
End If
End Function
Time.bas
Attribute VB_Name = "Time"
'Brian Thomasch
'--------------
Public Function TimedStart()
28. main.Timer.Enabled = True
WTime = TimeAmmount * 60
BTime = TimeAmmount * 60
End Function
Public Function TimeDisplay()
Dim TempA As Integer
Dim TempB As Integer
Dim TempC As Integer
Dim TempD As Integer
TempA = (WTime 60) - 0.499
TempB = WTime Mod 60
TempC = (BTime 60) - 0.499
TempD = BTime Mod 60
main.WTimeShow.Caption = TempA & ":" & TempB
main.BTimeShow.Caption = TempC & ":" & TempD
If TempA = 0 And TempB = 0 Then
MsgBox "White has run out of time. Game is awarded to Black."
main.Timer.Enabled = False
End If
If TempC = 0 And TempD = 0 Then
MsgBox "Black has run out of time. Game is awarded to White."
main.Timer.Enabled = False
End If
End Function
Validity.bas
Attribute VB_Name = "Validity"
'Brian Thomasch
'--------------
Public Function ValidityCheck()
Dim TempVM As Integer
If IndexSelected = IndexForMove Then
Valid = False 'Invalid move if you move it to the same space
GoTo endfunc
End If
If BoardTopPiece(IndexSelected) = "WhitePawn" Or _
BoardTopPiece(IndexSelected) = "BlackPawn" Then
PawnFunction
End If
If BoardTopPiece(IndexSelected) = "WhiteRook" Or _
BoardTopPiece(IndexSelected) = "BlackRook" Then
29. RookFunction
End If
If BoardTopPiece(IndexSelected) = "WhiteKnight" Or _
BoardTopPiece(IndexSelected) = "BlackKnight" Then
KnightFunction
End If
If BoardTopPiece(IndexSelected) = "WhiteBishop" Or _
BoardTopPiece(IndexSelected) = "BlackBishop" Then
BishopFunction
End If
If BoardTopPiece(IndexSelected) = "WhiteQueen" Or _
BoardTopPiece(IndexSelected) = "BlackQueen" Then
QueenFunction
End If
If BoardTopPiece(IndexSelected) = "WhiteKing" Or _
BoardTopPiece(IndexSelected) = "BlackKing" Then
KingFunction
End If
endfunc:
End Function
'-----------------------
'-----------------------
'-----PAWN FUNCTION-----
'-----------------------
'-----------------------
Public Function PawnFunction()
'-------------------------
'-----Black Pawns---------
'-------------------------
If BoardTopPiece(IndexSelected) = "BlackPawn" Then
BlackTurnCheck
If Continue = True Then
If BoardTopPiece(IndexSelected + 8) = "" Then
ValidMoves(0) = IndexSelected + 8
End If
If BoardTopPiece(IndexSelected + 7) = "WhitePawn" Or _
BoardTopPiece(IndexSelected + 7) = "WhiteRook" Or _
BoardTopPiece(IndexSelected + 7) = "WhiteKnight" Or _
BoardTopPiece(IndexSelected + 7) = "WhiteBishop" Or _
BoardTopPiece(IndexSelected + 7) = "WhiteQueen" Or _
BoardTopPiece(IndexSelected + 7) = "WhiteKing" Then
ValidMoves(1) = IndexSelected + 7
End If
If BoardTopPiece(IndexSelected + 9) = "WhitePawn" Or _
BoardTopPiece(IndexSelected + 9) = "WhiteRook" Or _
BoardTopPiece(IndexSelected + 9) = "WhiteKnight" Or _
BoardTopPiece(IndexSelected + 9) = "WhiteBishop" Or _
30. BoardTopPiece(IndexSelected + 9) = "WhiteQueen" Or _
BoardTopPiece(IndexSelected + 9) = "WhiteKing" Then
ValidMoves(2) = IndexSelected + 9
End If
'------------------
'-Pawn Double Move-
'------------------
If Row = 2 Then
ValidMoves(3) = IndexSelected + 16
End If
Else: GoTo endfunc
End If
End If
'----------------------------
'--------White Pawns---------
'----------------------------
If BoardTopPiece(IndexSelected) = "WhitePawn" Then
WhiteTurnCheck
If Continue = True Then
If BoardTopPiece(IndexSelected - 8) = "" Then
ValidMoves(0) = IndexSelected - 8
End If
If BoardTopPiece(IndexSelected - 7) = "BlackPawn" Or _
BoardTopPiece(IndexSelected - 7) = "BlackRook" Or _
BoardTopPiece(IndexSelected - 7) = "BlackKnight" Or _
BoardTopPiece(IndexSelected - 7) = "BlackBishop" Or _
BoardTopPiece(IndexSelected - 7) = "BlackQueen" Or _
BoardTopPiece(IndexSelected - 7) = "BlackKing" Then
ValidMoves(1) = IndexSelected - 7
End If
If BoardTopPiece(IndexSelected - 9) = "BlackPawn" Or _
BoardTopPiece(IndexSelected - 9) = "BlackRook" Or _
BoardTopPiece(IndexSelected - 9) = "BlackKnight" Or _
BoardTopPiece(IndexSelected - 9) = "BlackBishop" Or _
BoardTopPiece(IndexSelected - 9) = "BlackQueen" Or _
BoardTopPiece(IndexSelected - 9) = "BlackKing" Then
ValidMoves(2) = IndexSelected - 9
End If
'------------------
'-Pawn Double Move-
'------------------
If Row = 7 Then
ValidMoves(3) = IndexSelected - 16
End If
Else: GoTo endfunc
End If
End If
endfunc:
End Function
'------------------------------
31. '------------------------------
'--------Rook Function---------
'------------------------------
'------------------------------
Public Function RookFunction()
Dim TempB As Integer
If Left(BoardTopPiece(IndexSelected), 1) = "B" Then 'if Piece is Black Then
BlackTurnCheck
If Continue = True Then
TempB = IndexSelected - 1
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
If TempB = 7 Or TempB = 15 Or TempB = 23 Or TempB = 31 Or TempB = 39
Or _
TempB = 47 Or TempB = 55 Or TempB = 63 Then
GoTo breaker1
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
GoTo breaker1
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker1
End If
TempB = TempB - 1
End If
Loop
breaker1:
TempB = IndexSelected + 1
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
If TempB = 0 Or TempB = 8 Or TempB = 16 Or TempB = 24 Or TempB = 32 Or
_
TempB = 40 Or TempB = 48 Or TempB = 56 Then
GoTo breaker2
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
GoTo breaker2
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker2
End If
TempB = TempB + 1
End If
Loop
breaker2:
TempB = IndexSelected + 8
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
GoTo breaker3
End If
32. If TempB > 64 Or TempB < 0 Then
GoTo breaker3
End If
TempB = TempB + 8
Loop
breaker3:
TempB = IndexSelected - 8
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
GoTo breaker4
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker4
End If
TempB = TempB - 8
Loop
breaker4:
End If
End If
'--------------------------------
If Left(BoardTopPiece(IndexSelected), 1) = "W" Then
WhiteTurnCheck
If Continue = True Then
TempB = IndexSelected - 1
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
If TempB = 7 Or TempB = 15 Or TempB = 23 Or TempB = 31 Or TempB = 39
Or _
TempB = 47 Or TempB = 55 Or TempB = 63 Then
GoTo breaker5
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker5
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker5
End If
TempB = TempB - 1
End If
Loop
breaker5:
TempB = IndexSelected + 1
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
If TempB = 0 Or TempB = 8 Or TempB = 16 Or TempB = 24 Or TempB = 32
Or _
TempB = 40 Or TempB = 48 Or TempB = 56 Then
GoTo breaker6
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker6
33. End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker6
End If
TempB = TempB + 1
End If
Loop
breaker6:
TempB = IndexSelected + 8
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker7
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker7
End If
TempB = TempB + 8
Loop
breaker7:
TempB = IndexSelected - 8
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker8
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker8
End If
TempB = TempB - 8
Loop
breaker8:
End If
End If
TempB = 0
TempVM = 0
End Function
'----------------------------------------------------------
'----------------------------------------------------------
'--------Knight Function-----------------------------------
'----------------------------------------------------------
'----------------------------------------------------------
Public Function KnightFunction()
TempMoveNum = 0
If Left(BoardTopPiece(IndexSelected), 1) = "B" Then
BlackTurnCheck
If Continue = True Then
TempMoveSpaces = 6
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -6
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = 10
34. SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -10
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = 15
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -15
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = 17
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -17
SpotChecker4Black (TempMoveSpaces)
Else: GoTo endfunc
End If
End If
'---------------------------------------------------
If Left(BoardTopPiece(IndexSelected), 1) = "W" Then
WhiteTurnCheck
If Continue = True Then
TempMoveSpaces = 6
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -6
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = 10
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -10
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = 15
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -15
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = 17
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -17
SpotChecker4White (TempMoveSpaces)
Else: GoTo endfunc
End If
End If
endfunc:
End Function
'------------------------------
'--------Bishop Function-------
'------------------------------
Public Function BishopFunction()
Dim TempB As Integer
If Left(BoardTopPiece(IndexSelected), 1) = "B" Then
BlackTurnCheck
If Continue = True Then
TempB = IndexSelected - 7
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
If TempB = 7 Or TempB = 15 Or TempB = 23 Or TempB = 31 Or TempB = 39
Or _
TempB = 47 Or TempB = 55 Or TempB = 63 Then
35. ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
GoTo breaker1
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
GoTo breaker1
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker1
End If
TempB = TempB - 7
End If
Loop
breaker1:
TempB = IndexSelected + 7
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
If TempB = 0 Or TempB = 8 Or TempB = 16 Or TempB = 24 Or TempB = 32 Or
_
TempB = 40 Or TempB = 48 Or TempB = 56 Then
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
GoTo breaker2
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
GoTo breaker2
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker2
End If
TempB = TempB + 7
End If
Loop
breaker2:
TempB = IndexSelected + 9
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
GoTo breaker3
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker3
End If
TempB = TempB + 9
Loop
breaker3:
TempB = IndexSelected - 9
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "W"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "W" Then
36. GoTo breaker4
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker4
End If
TempB = TempB - 9
Loop
breaker4:
End If
End If
'--------------------------------
If Left(BoardTopPiece(IndexSelected), 1) = "W" Then
WhiteTurnCheck
If Continue = True Then
TempB = IndexSelected - 7
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
If TempB = 7 Or TempB = 15 Or TempB = 23 Or TempB = 31 Or TempB = 39
Or _
TempB = 47 Or TempB = 55 Or TempB = 63 Then
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
GoTo breaker5
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker5
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker5
End If
TempB = TempB - 7
End If
Loop
breaker5:
TempB = IndexSelected + 7
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
If TempB = 0 Or TempB = 8 Or TempB = 16 Or TempB = 24 Or TempB = 32 Or
_
TempB = 40 Or TempB = 48 Or TempB = 56 Then
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
GoTo breaker6
Else:
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker6
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker6
End If
TempB = TempB + 7
End If
Loop
37. breaker6:
TempB = IndexSelected + 9
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker7
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker7
End If
TempB = TempB + 9
Loop
breaker7:
TempB = IndexSelected - 9
Do While BoardTopPiece(TempB) = "" Or Left(BoardTopPiece(TempB), 1) = "B"
ValidMoves(TempVM) = TempB
TempVM = TempVM + 1
If Left(BoardTopPiece(TempB), 1) = "B" Then
GoTo breaker8
End If
If TempB > 64 Or TempB < 0 Then
GoTo breaker8
End If
TempB = TempB - 9
Loop
breaker8:
End If
End If
TempB = 0
If Queen = False Then 'If this is called from a queen movement, dont clear the
TempVM
TempVM = 0 'so RookFunction will pick up where this left off.
End If
End Function
'------------------------------
'--------Queen Function--------
'------------------------------
Public Function QueenFunction()
Queen = True
BishopFunction
RookFunction
Queen = False
TempVM = 0
End Function
'------------------------------
'--------King Function---------
'------------------------------
38. Public Function KingFunction()
If Left(BoardTopPiece(IndexSelected), 1) = "B" Then
BlackTurnCheck
If Continue = True Then
TempMoveSpaces = 8
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = 9
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = 7
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = 1
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -1
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -8
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -9
SpotChecker4Black (TempMoveSpaces)
TempMoveSpaces = -7
SpotChecker4Black (TempMoveSpaces)
Else: GoTo endfunc
End If
End If
If Left(BoardTopPiece(IndexSelected), 1) = "W" Then
WhiteTurnCheck
If Continue = True Then
TempMoveSpaces = 8
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = 9
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = 7
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = 1
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -1
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -8
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -9
SpotChecker4White (TempMoveSpaces)
TempMoveSpaces = -7
SpotChecker4White (TempMoveSpaces)
Else: GoTo endfunc
End If
End If
endfunc:
End Function
39. Watching.bas
Attribute VB_Name = "Watching"
'Brian Thomasch
'--------------
Public Function WatchMain()
Call Check
End Function
'Rook 5
'Bishop 5
'Knight 4
'Queen 7
'King 10
'Pawn 3
Public Function PointTotals()
Dim Temp%
WPoints = 0 'Reset Point totals at 0
BPoints = 0
Temp = 0
Do
If Pieces(Temp) = "WRook" Then WPoints = WPoints + 5
If Pieces(Temp) = "WKnight" Then WPoints = WPoints + 4
If Pieces(Temp) = "WBishop" Then WPoints = WPoints + 5
If Pieces(Temp) = "WQueen" Then WPoints = WPoints + 7
If Pieces(Temp) = "WKing" Then WPoints = WPoints + 10
If Pieces(Temp) = "WPawn" Then WPoints = WPoints + 3
If Pieces(Temp) = "BRook" Then BPoints = BPoints + 5
If Pieces(Temp) = "BKnight" Then BPoints = BPoints + 4
If Pieces(Temp) = "BBishop" Then BPoints = BPoints + 5
If Pieces(Temp) = "BQueen" Then BPoints = BPoints + 7
If Pieces(Temp) = "BKing" Then BPoints = BPoints + 10
If Pieces(Temp) = "BPawn" Then BPoints = BPoints + 3
Temp = Temp + 1
Loop While Temp < 32
End Function