Create A Tic-tac-toe Game But None Of The Tic-tac-toe Tutorials Use 2 Dimensional Arrays

Mar 14, 2010

I am new to VB, trying to create a tic-tac-toe game but none of the tic-tac-toe tutorials use 2 dimensional arrays. Since tic-tac toe is 3x3 I created 9 buttons and want either an X or an O to appear depending on where the user clicks. I want one set of instructions to handle the multiple buttons. I was told to use Case statements.

This is what I have so far. Not sure how much is right but hopefully it gives you an idea of what I am looking for.

[Code]...

View 20 Replies


ADVERTISEMENT

Declaring Two Dimensional Arrays?

Feb 16, 2009

I am trying to set up a number of two dimensional arrays that will be accessed from several forms in the project. I have set up a module to declare all public variables.When I declare the array (Using variables to determine the size of each dimension), when I go to run it, I get an out of index error.If I declare it them as public variables within the form, I don't get the error but then the input cannot be accessed from other forms.Am I completing incorrectly in the module or is there something else I ought to be doing.

The code within the form is

Dim Boardresult(NumBoards, Numteams) As Integer
Dim compass(NumBoards, Numteams) As Boolean

Where NumBoards and Numteams have been input and stored previously.

View 4 Replies

Make Two Dimensional Arrays?

Nov 19, 2011

Dim Paper As Graphics
Paper = picBox.CreateGraphics()
Paper.Clear(Color.White)

[code].....

View 12 Replies

Merging Two One-dimensional Arrays?

Jul 4, 2011

I have two one-dimensional arrays filled with dates. I want to join them into one array.

View 3 Replies

2 Dimensional Arrays Of Control Objects

Jul 11, 2009

I have the read the article "Creating Control Arrays in Visual Basic .NET" (link: [URL]) and I its very good and useful code for 1D array of objects. What if someone wants to make a 2D array of control objects. For example creating a "table" of 8x8 buttons that will be able to change properties by using the arrays x-y coordinates. Something like button(x,y). backcolor.black or similar.

View 3 Replies

Accessing Two Dimensional Arrays Within A Class?

Aug 30, 2011

Ive currently got this:

Public Class World
Dim StringA() As String
Property SetString() As String()
Get

[code]....

I need StringA to be a Two-Dimensional Array. I've played around with it and was unable to figure it out..

View 6 Replies

Dynamicly Creating Two-dimensional Arrays

Mar 6, 2011

I have the followig problem; i want to make a class with a private field as a 2-dimensional array, where it's dimension is set in the constructor of the class.Contained data does not matter at this moment.I've looked a bit around but couldn't find a direct solution to my problem, is this possible in VB.NET? [code]

View 2 Replies

Saving 2-dimensional Arrays To Settings?

Jun 30, 2011

I have two different 2-dimensional arrays. I assume the setting i need to save them to is a string setting, as is the cast with regular integer arrays. The first 2-d array I need to save is an integer, the second a decimal.

Let's say the settings are called my.settings.2darray1 and my.settings.2darray2
Let's also say the arrays are:

vb

dim 2darray1(50, 99) as integer dim 2darray2(50, 99) as decimal

What would the code be to load each array and save each array?

View 4 Replies

Sort Multi-dimensional Arrays?

Oct 18, 2010

is it possible to sort Multi-dimensional Arrays? If the answer is yes could someone help me giving some hints on how to start?

View 6 Replies

VS 2010 Multi-dimensional Arrays

May 24, 2011

I have a string, which can easily be splitted by seperators into an array.The output has to be splitted again an move into a multi-dimensional array (2nd index)[code]

View 2 Replies

Grasping The Concept / Context Of Two Dimensional Arrays?

Oct 29, 2010

I am having difficulties grasping the concept / context of two dimensional arrays. For the assignment I am working on I am required to use radio buttons to allow a user to vote if they like or dislike an item from a combo box. The contents of the combo box have been populated through the IDE via tht item property.I understand how to set up my rows and columns, which will be, (0 to 4), (0 to 1). The trouble I am having is how to record and display the votes and have them correspond to the selected item from the combo box. Can anyone give me an example of how something like this works?

View 9 Replies

Multi Dimensional Arrays Reading A Letter From It?

Feb 18, 2011

ok so im having issues with this

Select Case a(b, 3)
Case "d"
c = 0

[Code]....

OK so a(b, 3) has either the letter d,e or f in it but when I try and read the multi dimensional array I don't think it picks anything up

View 3 Replies

Sharing Multi-dimensional Arrays Across Different Forms In VB?

Jul 9, 2011

I have a very simple 2D array, it holds a list of song titles, their genre, and their runtime. frmMain loads the array from a text file and allows me to manipulate it and boil it down to a desired (implicitly sized) playlist. i want to THEN pass that playlist array to a second form, frmPlaylist The problem i'm running into....When frmPLaylist calls the Property from frmMain I receive an error that VB cannot convert the string value to a two dimensional array. Simplified...frmPlaylist is all locked and ready to receive a 2D array, but frmMain seems to only be sending a single string variable. on frmMain

Public ReadOnly Property PlaylistOut() As String
Get
Return mstrTimedPlaylist(,)

[code].....

View 1 Replies

Get The Correct 1 Dimensional Array Return From A Function With Arrays?

Nov 9, 2009

[code]...

Expected Results: A scalar result of the comparison between Array1 and Array2 such that when Array1>Array2 it is true. See expected array above.
Actual Results: When Result(x) is true, all elements become Array1(x) and Array2(x) .What is wrong with the function?

View 5 Replies

One Dimensional Arrays (accumulate The Value Of Each Item Of The Array) And Classes

Dec 12, 2010

I have written a class for my one dimensional array The idea is to collect user information, put the info into an array and accumulate the value of each item of the array so there is a running total. The problem is that the code is not totalling the array when my btnSum is clicked or maybe at all. I am getting no errors, but I am also getting no total.

[Code]...

View 9 Replies

Using Parallel One-dimensional Arrays To Calculate A Letter Grade?

Jul 27, 2011

The exercise prior to this one had us use two parallel arrays that store a letter grade (A, B, C, D, F) and the minimum points needed for each grade. The user input the points earned by the student and the program shows their letter grade. It took a minute, but I got that one done, and it does what it's supposed to do.This exercise has us modify that exercise to ask for the (via InputBox in MainForm Load event) total points possible. The grade is then determined by percentage of the total points possible. For instance, if x is the user input, an "A" would be 90% of x.

View 4 Replies

Two-dimensional Arrays - Display The Total Bonus Paid To All Salespeople?

Apr 24, 2010

I am doing in my Visual Basic Reloaded:second edition school book. Ok here is all the information the case problem gives me and what it wants me to do.JM Sales employs 10 salespeople. The sales made by the salespeople during the months of January,February, and March are shown in Figure 8.52. The sales manager wants an application that allows him to enter the current bonus rate. The application should display each salesperson's number (1 through 10), total sales ammount, and total bonus ammount. It also should display the total bonus paid to all salespeople. Be sure to use one or more array in the application.Then it gives you a table with the salespersons 1-10 sales amount january February and March.(this is the figure 8.52)Here is a duplicate table of it below.

Salesperson January February March
----------- ------- -------- -------
1 2400 3500 2000
2 1500 7000 1000
3 600 450 21

View 2 Replies

Create FLASH Tutorials For Programming ( Or For Something Else ) With This Program.>>

Jun 29, 2010

Create FLASH tutorials for Vb.Net programming ( or for something else ) with this program.>>

[URL]

View 1 Replies

Multi-Dimensional Arrays - Code To Set Array Values And Store Them In A Variable

Aug 7, 2010

I have this code to set array values and store them in a variable,

Dim productName As String()
Dim productPrice As String()
Dim productCategory As String()

[CODE]...

How do you get the variable values to output like this?

<input type="text" value="Chang Beverages $19.00" id="Chang" /><br />
<input type="text" value="Ipoh Coffee Beverages $46.00" id="Ipoh Coffee" /><br />
<input type="text" value="Gula Malacca Condiments $19.45" id="Gula Malacca" /><br />

View 2 Replies

One Dimensional Arrays - Display The Number Of Employees Who Have Earnt A Salary Within The Ranges Below

May 25, 2009

i am a beginner learning vb.net. I have an excercise to create a form and on clicking the totals buttons it should display the number of employees who have earnt a salary within the ranges below. Now this code works, but i want to substitute the Select Case Statement with a more efficient for..next statment to increment my counter. The code is:

[Code]....

View 2 Replies

Game Programming :: Multi-dimensional Array Ordering

Apr 20, 2009

I have a multi-dimensional array storeHand(20,6) which stores 6 ints. The int at point 0 in each array represents a rank. So the array ends up looking like this:

(7, 0, 0, 3, 5, 7)
(6, 2, 3, 0, 6, 5)
(5, 0, 0, 0, 13, 4)
(8, 0, 0, 0, 0, 3)
(2, 0, 0, 0, 0, 1)

I want to re-order the array so that the higher the integer value at position 0 is, the higher it's position will be in the sortedHand(20,6) array. So as above, I'd want sortedHand(20, 6) to look like this at the end:

[Code]...

View 1 Replies

Two Dimensional Array Poker Game In Visual Basic

Apr 24, 2012

I have finally been stumped this semester in my Visual basic course. Mainly because I have to write a program that is started from something that I have not created. I have to create a program that will take in info from the user, then spit out the poker hand that they are holding. For instance, the user will type in 1 for ace, 2 for 2, 3 for 3......10 for 10, 11 for Jack, and then in the next column type in C for Clubs, S for Spades.. and so on. Here is the code I have been given:

[Code]...

View 5 Replies

Game Programming :: Create A Picture Shuffle Game?

Jun 4, 2012

I am all new to Visual Basic 2008, I am trying to create a picture shuffle game, the problem is I cant seem to be able to move one picture from PictureBox1 to PictureBox2 onClick, here is a Code I written earlier:Sub ChangePicture(ByRef P1 As PictureBox, ByRef P2 As PictureBox)

[Code]...

View 1 Replies

Game Programming :: Create A Zombie Style RPG Game

Sep 11, 2009

Is there any visual basic 2005/2008 RPG games with the source code available for download.Could you possibly reply to this post with a link to the website with the game.Or is there a template i could use to try create a zombie style RPG game text or graphical.

View 2 Replies

Game Programming :: Alphanumeric String Arrays

Jul 30, 2009

I have a string array of size 51 CardListIn() representing randomly ordered cards in a deck {1d, 2d, ...14c} e.g. 9d = 9 of diamonds and so on. I then have 52 text boxes for user input. These have been put into an array of text boxes as so:[code...]

I want to search my original string array for any cards the user may input in any of the textboxes and then delete those entries from the string array.So say the user enters "1d" in one of the textboxes, I then want that removed from the string array.

I'm parsing through both the array and the text boxes fine, but for some reason that I cannot fathom, it doesn't find a match. The string array definitely contains "1d" and the textbox definitely contains "1d", but it doesn't register as a match. I've tried using Val() for the string array and the text boxes, but then it removes every entry beginning with a 1, e.g. "1d", "1h", "1c" & "1s".

View 8 Replies

Create A 2 Dimensional Arraylist?

Sep 17, 2009

Can I create a 2 dimensional arraylist in VB.net?

View 3 Replies

Create A 2-dimensional Array For A List?

Feb 12, 2010

I want to create a 2-dimensional Array for a List of five Names for males and another List of five Names for females.

And I want the list of names of males and that of females in a Text Box / List Box. This I couldn't do.

I know how to do this for a 1-Dimensional Array.

I give below what I tried.

Public
Class
Form1

[Code].....

View 6 Replies

Create A Multi-dimensional Array?

Sep 7, 2010

How do I create a multi dimensional array in visual basic. For example I have a soccer team with players. Each player has an id, first name, last name, address, phone number. How would I represent this using a multi dimensional array?

View 1 Replies

Create A One Dimensional Array With The Information Given?

Oct 13, 2010

I'm a beginner at programming so I'm going through the Clearly Visual Basic 2008 book. There is a problem that I'm doing called JM Sales Solution and I need to create a one dimensional array with the information given.

JM Sales employs 8 salespeople. The sales manager wants an application that allows him to enter a bonus rate. The application should use the rate, along with the 8 salespeople, in an array, to calculate each salesperson's bonus amount. The application should display each salesperson's number (1 through 8) and bonus amount. as well as the total bonus paid, in the interface.

I did the interface that's not a problem. My problem is the Create Report code. I had the program running and displaying but it didn't display all eight bonuses or the Bonus and Total Bonus paid at the end. I did some tweaking and now I can't even get it to run again. This is the code I'm currently on

[Code]...

View 4 Replies

Create A Visual 2 Dimensional Grid (x,y)?

Apr 8, 2011

I'd like to create a visual 2 dimensional grid (x,y) which contains an array of booleans that I could refer to by the 'coordinates' of the grid, and could actually SEE the grid on a form and work with it. for example:

If grid(10,20) = True Then Show(BlackSpot, grid(10,20))

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved