Comp 152 Project 5: Recursive Programming
Due April 7th at 11:55pm.
You will write a recursive solution to read a file describing hollowed
out shape and recursively color it in.
Write a program which will
- Read a text file consisting of 16 lines of text with 16 characters on
each line into a 2 dimensional array The file will be filled with the
characters 1 and 0
- a '1' represents a black cell, a 0 represents a white cell in the
- Take an element of the array from the user (for example 3 3 would be
the 4th line down and the forth column over since array indexes
start with 0)
- Fill in all of the white cells starting with the user's chosen array
element. Do so according to the following rules
- The Base Case: if the cell is already colored, just return and do
- Color the cell
- Recursively call your method on the cell just above this one
- Recursively call your method on the cell just to the left of this
- Recursively call your method on the cell just below this one
- Recursively call your method on the cell just to the right of this
- Print out your new array.
As usual, make sure you comment your code.
your readme should contain
Submit on Moodle as usual
- your name
- a description (about a paragraph) of what you did, how you got the
starting point for the user,
- anything that wasn't complete.