|
-
Mar 27th, 2001, 01:59 PM
#1
If I have an Array of 1..10, 1..20
and this Array simbolizes the location of a player on the board how can i retrive the slot the player is right now.
What I do know how to do is to follow the player from the beginnig and saving his location to two different variables.
10x David
-
Mar 27th, 2001, 02:10 PM
#2
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Mar 27th, 2001, 02:14 PM
#3
Lively Member
I'm assuming that this array is declared as boolean??
Code:
Dim i As Byte, j As Byte, Found As Boolean
i = 1
While Found = False
For j= 1 To 20
If PlayerIsHere(i,j) = True Then
Found = True
Exit For
End If
Next J
If Found = False Then i = i +1
Wend
MsgBox "Player is at cell " &i &"," &"j"
Any Help
-
Mar 27th, 2001, 02:17 PM
#4
how on earth did you understand the question!!??

(No Offense Dave)
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Mar 27th, 2001, 02:19 PM
#5
Lively Member
Do a lot of work with arrays
-
Mar 31st, 2001, 01:13 PM
#6
10x alot
and sorry english is only a third language for me, so id dont make myself clear enough
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|