Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Gen(char map[row][col],int row, int col){
- srand(time(NULL));
- int randRow_k = rand()%row;
- int randCol_k = rand()%col;
- map[randRow_k][randCol_k] = 'K';
- int randRow_p = rand()%row;
- int randCol_p = rand()%col;
- if(randRow_k != randRow_p || randCol_k != randCol_p){
- map[randRow_p][randCol_p] = 'P';
- }
- else if (randRow_k == randRow_p && randCol_k == randCol_p){
- randRow_p = rand()%row;
- randCol_p = rand()%col;
- map[randRow_p][randCol_p] = 'P';
- }
- }
- void player(char map[row][col],int row, int col){
- srand(time(NULL));
- }
- void update(char map[row][col],int row, int col){
- int i,j;
- for (i = 0; i < row;i++){
- for (j = 0; j < col ; j++){
- printf("%4c", map[i][j]);
- }
- printf("\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement