Lesson AB24 - Recursive Array Programming |
|
|
EraseObject Background: An image can be represented as a grid of black and white cells. An object in the image is defined as a group of connected black cells that touch on one side (Please note: cells are not connected if they only touch at a corner). The diagram below represents an image that contains two objects, therefore, and one of them consists of a single cell. A way to test whether a group of cells is an object (within an image) is to ask:
Many drawing or graphic programs include erasing features. With such an eraser tool, an object can be completely erased by double-clicking on that object with a mouse. This problem involves erasing an object stored as a collection of black squares in a matrix image. Assignment:
Instructions:
|
|