I am trying to copy the map. It can only copy part of the map.

void randomize(int Width,int Height){
list = new int[Width*Height];
for ( int x=0;x<Width;x++)
{
for( int y = 0; y < Height; y++)
{
list[x*y]=map[x][y];
cout << map[x][y];
}
cout<<"\n";
}
}

It's not perfectly random by any stretch, but the easiest would be to choose a row and choose a column, check if that element's already in the list, if not add it, if so, choose a new row and column. I understand what you are trying to do, but I don't think it's the best approach.

I want to make a map with random numbers from the map. First, copy the map. Then paste it in the list. Now I need to shuffle those numbers.I don`t want to shuffle the number zero. Can you give me a hint?

void randomize(int Width,int Height){
list = new int*[Width];
for ( int x=0;x<Width;x++)
{
list[x] = new int[Height];
for( int y = 0; y < Height; y++)
{
list[x][y]=map[x][y];
cout << map[x][y];
}
cout<<"\n";
}
}

Choose an x from the range of x, chose a y from the range of y, choose x1 from the range of x, choose y1 from the range of ys.

If list[x][y] or list[x1][y1] is 0, neither is swapped and a new set of x,y,x1,y1 is chosen.
Else, swap list[x][y] and list[x1][y1] and pick a new set of x,y,x1,y1

It's not as random as can be, but it should suffice for your assignment.

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...

Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.

This is the result of previous question answered :

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...