Question: Objective: Use advanced file I/O techniques to manipulate files directly. Problem: Mario Paint was a great innovation in its time allowing people with a home

Objective: Use advanced file I/O techniques to manipulate files directly. Problem: Mario Paint was a great innovation in its time allowing people with a home console to create art and music easily. One of the features of Mario Paint was that it let users create their own 8-bit stamps to use within the game. With this idea, you are going to create a program that will allow users to create black and white pixel art. Since all of the output will be file-based, we cant easily add color to the drawings. Details: The users canvas will be a grid (50 characters x 50 characters) o The newline character on each line is not considered to be part of the canvas o Remember that a newline character in Windows is treated as 2 bytes Input will consist of a series of commands read from a file Commands o 1 Pen up o 2 Pen down o 3, D, # Move pen in given direction the given number of characters Example 3, N, 10 would move the pen up (north) 10 characters If the pen is down, the space where the pen resides is not filled in Only the 10 spaces above the current position would be filled Directions N north / up S south / down E east / right W west / left o 4 Display output file in console o B bold on Use # to draw o b bold off Use * to draw No command will be given that makes the pen go outside of the canvas space All drawing is to be done directly in the file o Do not use a 2-dimensional array to hold the drawing and output it to the file at the end of the program. If the pen is down and moved, write the given number of characters in the file in the given direction The movement commands do not include the current spot of the pen o For example if the pen is down, the command 3, E, 2 would draw in the two spaces to the right of the current pen location. In the case of intersecting lines, bold will always take precedence. By default, bold is off when the program begins. The pen will begin at row 1, column 1 at the start of the program. Input: All input will be read from a file named commands.txt. All commands in the file will be valid and of the proper format. Each command will be on a separate line. Output: Each input file will produce an output file named paint.txt. If a print command (4) is listed in the input file, display the current state of the entire file to the console window, making sure that each line of the output file is displayed on a separate line in the console window. After the file has been displayed to the console, send two blank lines to the console window as a buffer for the next print command in the file. After the entire input file has been processed, display the completed artwork to the console before the program exits.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!