CS60 Homework Assignment 4 --------------------------- Due Mon Oct 6th, 1:00pm Write a simple paint program that draws a 10x10 character palette to the screen and allows a use to input a character to draw and (x,y) coordinates specifying the position of the new character. The program should have the following high level structure: initialize palette array with '_' characters initialize input character variable to something other than '!' while the inputted character is not equal to '!' draw palette ask user for a character to draw ask user for coordinates for new character At a minimum, the 'draw palette' step must be implemented as a function that takes as a parameter the 10x10 array and draws the contents of the array. You may choose to write other functions, but you must at least write the draw palette routine as a function. When the user inputs a '!' character, with any coordinates, the program should exit. HINT: watch out for the scanf problem where the newline from one scanf (the coordinate scanf) falls through to the input of the next (when the loop returns to asking for an input character)! Turnin ------------- The turnin tag for this assignment is 'hw4'. Please include the code, a README if required, and a typescript showing at least 4 moves followed by the exit move. Sample Output ------------- [nurmi@localhost hw4]$ gcc hw4.c; ./a.out _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Enter a character to draw: @ Enter X,Y coordinates (x,y): 0,0 @ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Enter a character to draw: $ Enter X,Y coordinates (x,y): 3,9 @ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Enter a character to draw: $ Enter X,Y coordinates (x,y): 2,2 @ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Enter a character to draw: * Enter X,Y coordinates (x,y): 2,9 @ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $ _ _ _ _ _ _ * _ _ _ _ _ _ _ _ _ $ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Enter a character to draw: r Enter X,Y coordinates (x,y): 2,6 @ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $ _ _ _ r _ _ * _ _ _ _ _ _ _ _ _ $ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Enter a character to draw: ! Enter X,Y coordinates (x,y): 0,0 [nurmi@localhost hw4]$