Hello,
I'm having a problem understanding what to do in this program, I would appreciate any suggestions. Thanks in advance for the responses and the help. Here it is:
A Computer graphics image is composed of rectangular points on the screen. In a black and white picture, we can use 0 to represent white and 1 for black. The picture is a 5 x 5 square on the screen as follows:
1 1 0 1 0 1 1 0 0 0
1 0 0 1 1 1 0 0 0 0
1 0 1 1 1 1 0 0 0 0
0 1 1 0 1 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
(initial image) (image after exe of ErasePic function)
Two black pixels are part of the same object if we can get from one to the other with horizontal and vertical moves. Thus, Fig 1(initial image) contains 2 objects.
Write a function ErasePic to erase the object of which the given black pixel is part. Invoking the function for the bold face 1 results in erasing a representation of the rightmost object of Fig 1 (see Fig 2).
Thanks again for the help, and GOD BLESS AMERICA!
I'm having a problem understanding what to do in this program, I would appreciate any suggestions. Thanks in advance for the responses and the help. Here it is:
A Computer graphics image is composed of rectangular points on the screen. In a black and white picture, we can use 0 to represent white and 1 for black. The picture is a 5 x 5 square on the screen as follows:
1 1 0 1 0 1 1 0 0 0
1 0 0 1 1 1 0 0 0 0
1 0 1 1 1 1 0 0 0 0
0 1 1 0 1 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
(initial image) (image after exe of ErasePic function)
Two black pixels are part of the same object if we can get from one to the other with horizontal and vertical moves. Thus, Fig 1(initial image) contains 2 objects.
Write a function ErasePic to erase the object of which the given black pixel is part. Invoking the function for the bold face 1 results in erasing a representation of the rightmost object of Fig 1 (see Fig 2).
Thanks again for the help, and GOD BLESS AMERICA!