Comp 152 Project 5: Recursive Programming

Due April 7th at 11:55pm.

Summary:

You will write a recursive solution to read a file describing hollowed out shape and recursively color it in.

Objective:

Write a program which will

  1. 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
    1. a '1' represents a black cell, a 0 represents a white cell in the array.
  2. 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)
  3. Fill in all of the white cells starting with the user's chosen array element. Do so according to the following rules
    1. The Base Case: if the cell is already colored, just return and do nothing
    2. Otherwise
      1. Color the cell
      2. Recursively call your method on the cell just above this one
      3. Recursively call your method on the cell just to the left of this one
      4. Recursively call your method on the cell just below this one
      5. Recursively call your method on the cell just to the right of this one
  4. Print out your new array.


As usual, make sure you comment your code.


Readme:

your readme should contain

Submit on Moodle as usual