![]() |
randomize chars in multi dimen array
Hi guys im making a minesweeper game. "Result" variable is equal to the NoMines, basically
i need to randomize the NoMines in the mineField multi dimensional array and then print the 'M' in the random positions in the array some in columns some in rows but randomly. Iv done something like this but im not sure how correct it is? size is the whole size of the mineField if user types 3 the grid is the square root of it printf grid mine size prints '?' depending on how large the size of the grid is ? ? ? ? ? ? this is how i need to random the character in the array ? ? M ? M ? i need to be able to print them in squares not sure how too? Code:
|
Re: randomize chars in multi dimen array
In your other thread I replied how to print the output. Now you can use that to randomize the Mines and no mines. Just dont print them but put them in size into size array. then display the array at the end. If you are unable to get it drop here a line and will let you have that.
|
Re: randomize chars in multi dimen array
thnxs buddy got it workin
|
Re: randomize chars in multi dimen array
Quote:
|
| All times are GMT +5.5. The time now is 18:11. |