This forum can be strict about rules (like putting code in code tags and giving descriptive thread titles). You will want to edit your post to include those code tags (see the forums FAQ link for instructions if you are unfamiliar) so that your topic does not get locked.

You might also provide a better description of what the code is doing/should be doing so we can better understand it. I see a lot of undefined/uninitialized variables in your code, which makes it difficult to understand exactly what you are doing. Some of what you have suggests to me that we will need to know what you know about arrays (and maybe other data types), so helping us understand what you know will help us help you.