hey.
Im making a RPG (my first) where you walk throu a maze and end at one random tile. Dont get it? Example
123456789
1 "#######"
2 "# # # # #"
3 "#--------#"
4 "######"
say you end at row two, but u could exit the maze at either 2,2 2,4 2,6 or 2,8
If i want this to be random (I.E. the computer randomly chooses which of the exits you go to), is their a way to only chose one of those coridantes,
and not one that has a "#" at it? this code wouldnt work:
exitrow: 1
exitcolumn: INT(9*RND)+1
END
this wouldnt work cuz it could chose a number with a # on it. So does anybody know how to make a random number only chose numbers 2, 4, 6, 8
out of my maze?
thnxs
PS srry if this was confusing
PPS the --- in the example are just their so the maze looks right, they wont be their in the end
more than one catch on random numbers
more than one catch on random numbers
4815162342
-
- Veteran
- Posts: 288
- Joined: Sat Feb 18, 2006 4:02 pm
Re: more than one catch on random numbers
Im not 100% sure are you behind what i think but here is my solution.jetq111 wrote:So does anybody know how to make a random number only chose numbers 2, 4, 6, 8
out of my maze?
It's pure mathematics
Code: Select all
Randomize Timer
For Counter = 1 TO 10
a = (INT(RND * 4) * 2) + 2 ' 2, 4, 6, 8 are possible values.
Print a
a = 0
Next Counter
If this was totally wrong answer to your question, sorry. Try explain again.
-
- Veteran
- Posts: 288
- Joined: Sat Feb 18, 2006 4:02 pm