Lab Description : Ben loves Kitties and his kitties are running free. You need to help Ben identify where his kitties are so he can get them all rounded up.
Each cell in the boolean matrix that contains a kitty will be set to true. Each cell that contains no kitty will be set to false. Use Math.random() to randomly place the trues and falses in the grid β try multiplying by numbers larger than 2 if you want fewer kitties in the grid.
As you work to help Ben recover his lost kitties, you will create an integer matrix that stores the number of kitties near each cell. Each cell that contains a kitty is set to 9. All other cells are set to the value of how many kitties are around them. This integer grid will be used to determine the best location from which to start collecting Benβs kitties.
Bonus Challange: Write a method to find the best place to drop a kitty collecting robot. The robot will fan out in all directions and collect all kitties within a 3 cell radius. Your method should return the location of the best place to drop the robot.
Boolean matrix(all random, trues represented by 1s)
0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 1
0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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