Here is an example input file:
10 10 1111 1 1 1 1 1 1 11 1 1 1 11 111 1 1 1 1 1 1 11111 1111 1 1 1 1111 11 1 1111111111
Your program will implement a color filling algorithm that given a starting position and a drawing color (i.e., a character) will fill in any open space with the specified drawing color. Of course to know what we mean by “open space” we have to name a border color. So, if we view `1' as our border color and we wanted to fill in the space at the top of the canvas we would use the following commands:
MyCanvas canvas= new MyCanvas(); canvas.load("image1.txt"); // loads image from file into canvas canvas.setBorder('1'); // specifies that 1 is the border character canvas.fill('*',0,0); // starting at position (0,0) fill area with *'s canvas.show(); // display the canvas
When the canvas is displayed we would expect to see this:
******1111 1*1******1 1***1*1*11 1**1*1**11 111****1*1 1 1*1***1 11111 1111 1 1 1 1111 11 1 1111111111
Notice that the color fills up, down, right, and left, but not diagonally.
The assignment will be graded according to the following criteria:
Correctness | 16 | pts |
Documentation | 2 | pts |
Conventions | 2 | pts |
Version Control | 2 | pts |
Total | 22 | pts |
Your program should be completely working and should follow all of the programming conventions named in class and explained in http://josephus.hsutx.edu/classes/all/javaconventions/ (including the use of comments that conform to the JavaDoc guidelines).
The instructor will grade your work based on what you have pushed to the hosted homework repository you have shared. For all assignments the program is due before the beginning of class on the due date. Repositories that show a commit time after that time will be graded as late.