Question
(C++) For this assignment, make sure that you comment your source code adequately. Your job is to write the fill function for a raster-based graphics
(C++)
For this assignment, make sure that you comment your source code adequately.
Your job is to write the fill function for a raster-based graphics program. The graphic is stored in a 2D array of symbols. The input to the function is the row and column cell of the pixel (symbol) to be changed and what symbol to change it to. The goal is to fill the enclosed shape (of one symbol) with the new symbol. This should be done recursively.
The program should dynamically read in an ascii art file, then prompt the user for the cell to fill and what symbol to fill it with. Then allow the user to save the new art. Example run:
Select from the options: (L)oad art, (F)ill, (S)ave art Choice? L File to read: art.txt
.. ..
.'~'$$$$$$$\ /$$$$$$>@@@@@>. `'$$$$$$$$$$$$ '>@@@@@>..'@@@@>''' '' '' '' '' '' '@@@@>'
o$$$$$$oo. o$$$$$$$$$$$.)$$$$$$$$$$
'>@@@@@>. >@@@@@>'o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$oooooo...>@@@@>'
''@@@@>''' '' ^^>@@@@>' >@@@@>'>@@@@>'
Select from the options: (L)oad art, (F)ill, (S)ave art Choice? FCell to begin Fill: Cell Row: 5 Cell Column: 27 Symbol: +.. ...@@@@@>. .@@@@@>. .@@@@@>. '@@@@@>' '@@@@>' '@@@@@@@@>' '' '' '' '' '' '' '@@@@>'
''@@@@>''' '' ^^Select from the options: (L)oad art, (F)ill, (S)ave art Choice? SFile to write: artn.txtSelect from the options oad art, Fill, ase art syrebek The rgv ? ?? the fsrctwis tir nva and cabs", cell ar tie pise! 'svrioll t he ch.rge
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started