This is the graphical editor problem. It's sort of a text version of the Microsoft Paint program. This one doesn't read in a file, it takes user input of commands to change the "image."
The commands to implement are as follows:
This is another 2D array problem, but again in Python it's a list of lists.
I'm not sure how clean I got the object design aspects of this, I have a class called Interface and a class called Drawing that handle the user input processing and the drawing of the image. Trouble is I kind of have some interface aspects in the main function. It seems to work, but probably could be cleaner.
The Interface class is a while loop that will allow you to continue to read commands until the exit command is given. I also implemented a commend to output a text menu of choices, although that wasn't really in the problem. Here is the menu.
Here is the Interface class, interface method. It's a loop that checks if you made a valid selection and returns your selection. (Here's the bad job by me, the X command is actually handled in the main function. So, that's where the design could be better. Maybe I'll still fix it)
The main function runs a loop that calls the interface and returns the command to be processed
It took a long time to write all the methods to process all the lists (maybe that's why I've posted this with some problems - haha) Here is the method to fill a region in the Drawing class. It determines what color you select as input and changes all of that color to a the new color.
See the full code on my Github