```
        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                while (treasures >= 0) {
                    mapArray[i][j] = rnd.nextInt(2);
                    treasures -= 1;
                }
            }
        }

```

The user specifies the array's height and width, along with how many "treasures" this array contains. The code should cycle through all of the array's elements, giving them a value of either 0 or 1 ( until the number of treasures entered by the user reaches 0 ).

Treasure indication is 1.

Right now the for loops only target the first ( [0] [0] ) element.