PLEASE USE PYTHON LANGUAGE For this project, we will be implementing a tool call
ID: 657185 • Letter: P
Question
PLEASE USE PYTHON LANGUAGE
For this project, we will be implementing a tool called "autofill". Some of you may be familiar with this tool from programs such as paint. You will be given a text file full of Xs and Os, looking like this:
OOOOOOXOOOO
OOOOOXOOOOO
OOOOXOOOOOO
XXOOXOOOOOO
XXXXOOOOOOO
OOOOOOOOOOO
The grid may be any size, but will always consist only of Xs and Os.
Autofill takes a given square, and if it is an X does nothing. If the square has an O in it, it changes the O to an X and autofills the square above, below, to the left, and to the right. An example run of the program:
Please enter a filename: input.txt
OOOOOOXOOOO
OOOOOXOOOOO
OOOOXOOOOOO
XXOOXOOOOOO
XXXXOOOOOOO
OOOOOOOOOOO
Please enter a square to fill, or q to exit: 1, 1
XXXXXXXOOOO
XXXXXXOOOOO
XXXXXOOOOOO
XXXXXOOOOOO
XXXXOOOOOOO
OOOOOOOOOOO
Please enter a square to fill, or q to exit: 6, 1
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
Please enter a square to fill, or q to exit: 4, 3
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
Please enter a square to fill, or q to exit: q
Invalid inputs are permitted to crash your program. Your autofill function should be recursive. Indexing starts at 1.