Advertisement

01.24.2008 at 07:56PM PST, ID: 23110124
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

TIC TAC TOE GAME IN VB

Asked by OCU in Game Programming User Interface

Tags:

Need help with this college project,
1.      Create a two player Tic-Tac-Toe game using pictureboxes as the 9 possible squares (you will have to design your own graphics for the O and X in paint).  
a.      Create a sub routine called XO_Click with the appropriate click arguments.  This routine should fill the clicked picturebox with the appropriate image.
b.      Dynamically add nine pictureboxes to your form.
c.      Dynamically assign the click event for each of these picturesboxes to your XO_Click code.
here is my code so far...

Am I i in the right track....Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
Public Class FrmMain
    Private Const intNumSpaces As Int16 = 9
    Private Const intSpacePerRow As Int16 = 3
    Private Const intxHeight As Int16 = 122
    Private Const intxWidth As Int16 = 115
    Private Const intMargin As Int16 = 20
    Private Const intLabelHeight As Int16 = 23
    Private titleBarHeight As Int16
 
    Private Sub FrmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim intBorderWidth As Int16 = (Me.Width - Me.ClientSize.Width) / 2
        titleBarHeight = Me.Height - Me.ClientSize.Height - 2 * intBorderWidth
        'set height and width of form
        Me.Height = Math.Ceiling(intNumSpaces / intSpacePerRow) * (intxHeight _
                    + intLabelHeight) + intMargin + titleBarHeight + 2 * intBorderWidth
        Me.Width = intSpacePerRow * (intxWidth + intLabelHeight) + intMargin + 2 * intBorderWidth
        'center form
        Me.Left = (My.Computer.Screen.WorkingArea.Width - Me.Width) / 2
        Me.Top = (My.Computer.Screen.WorkingArea.Height - Me.Height) / 2
        Dim i As Int16
        'loop through chairs
        For i = 0 To intNumSpaces - 1
            Dim seat As New PictureBox
            seat.Parent = Me
            seat.Left = (i Mod intSpacePerRow) * (intxWidth + intLabelHeight) + intMargin
            seat.Top = (i \ intSpacePerRow) * (intxHeight + intLabelHeight) + intMargin
            seat.Height = intxHeight
            seat.Width = intxWidth
            seat.Image = Image.FromFile("..\..\images\x.jpg")
            seat.Name = (i + 1).ToString
            seat.Tag = ""
        Next
    End Sub
    Private Sub XO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim p As PictureBox
        p = CType(sender, PictureBox)
        
    End Sub
 
   
End Class
 
Loading Advertisement...
 
[+][-]01.24.2008 at 08:03PM PST, ID: 20740001

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Game Programming User Interface
Tags: VB
Sign Up Now!
Solution Provided By: ee_rlee
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628