0

I have made the treasure hunt game using 2D array. where '#' are the walls '*' is the border of the game.

i want to place '@' as tresure at random postion between the spaces of 2D Array of size

[20][20].

i know i have to use

#include<time.h>

time_t t;

time(&t);

srand(t);

int r = rand() % 18; r is the position for y position of 2D array.

but i have to place '@' at more than one place and at different position.

and other thing '@' char cant be place on the borders.

treasure on each space line could be 3,2 or 1 but not 0.

Thanks in advance