Hi. Im basically new to visual basic and im enjoying it a lot. I have a project for my Computer Programming class. This is what I am trying to do but have no idea to start it, im pretty sure if I understood how to link the array to the if statements and the timer I would be ok. I am trying to make a game where there are 4 circles inside a picture box. When you click start game it goes to level 1 and the circles will flash a color in a randomized order. Once the computer is done making the pattern you will have to click the circles in the same pattern to pass the level. Its basically simon says. I really dont know much about arrays or much of what to do for this but im pretty good with if statements. If someone could just give me an example of code to get me started or their opinions on what to do it would be greatly appreciated. Thanks

Help with arrays
Jeff Walsh
OK, her are a few thoughts on this as it sounds a bit like an assignment.
You'll want to have some form of random number generator. Each color will have a number associated with it. So if your going to be using say 6 different colors then you can create function which will generate a random number between 1 and 6
The next part is how many numbers you want to have in the sequence. This is where you can use an array or another collection like an arraylist or list which would allow you to store as many numbers in a sequence as you want. So potentially each time you get it correct it would generate a new sequence of random numbers - slightly longer (ie one more to remember).
I would look at the arraylist myself.
You will then have to loop however many items you want to put in this collection (array/arraylist) and generate a random number and place it in the collection elements. This would generate you sequence.
Then you would iterate through the collection using a looping construct (say a for each or for next loop) and for each number that you find in that element would display something on the screen. (I would start by showing the number and waiting for a little while before showing the next number - then I would translate these numbers into a color circle)
Then you allow the user to click controls and each control would add compare to an item in the collection. If they matched then they could enter the next, if they didnt then it would be a wrong sequence.
To start off I would work on the logic of the application rather than the appearance. I would have it generate numbers instead of colors and allow them to click on buttons corresponding to those numbers. Once you get the logic working then you can map the numbers to colors and the buttons to Picturebox controls. The reason I would do it using numbers is that the randomness of the sequence is as a result of numbers not colors. You use a randon number generator.
That should be some thoughts/ideas to get you going. If you have specific issues with commands/keywords etc. then do ask but please dont expect us to do the application for you - we dont do assignments. :-)
ratslav
Create a class for your circle objects and then use a list (of MyCircleClass) to keep track of the collection of circles...(versus an array)
Dim MyListOfCircles as New List (of MyCircleClass)
Add to your list
MyListOfCircles.Add(Circle1)
to iterate through the collection you can
For each mcc as MyCircleClass in MyListOfCircles
console.writeline(mcc.propertyname)
....
Kapalic
You can also check out http://msdn2.microsoft.com/en-us/library/xk24xdbe(VS.80).aspx for some more info on what an array is and how you can use it...
Best regards,
Johan Stenberg