.

CAB202 Topic 3, Exercise 2: Fill Rectangle 1

Requirements:

Complete the implementation of the fill_rect function. This function further extends your toolbox of graphics functions by adding the ability to draw filled rectangles. The hash-tags for this exercise are: #cab202 and #cab202FillRect1.

This exercise will give you practice with the drawing functions in the ZDK and the use of global variables to transfer data between functions. Given the definition of a rectangle, you will complete a function that uses pre-existing functions defined in the ZDK to draw a solid rectangle. This function does not return a result.

To complete the program, follow the instructions detailed in the in-line comments in the fill_rect() function.

Notes

  • The supplied test driver produces output similar to that shown below.
    CAB202 Topic 3 Exercise 2
  • Use this test driver to implement and test your function prior to submission.

Things to avoid

  • Don’t rely on anything you do in your main function. AMS will compile your submission as part of a larger program and call setup() and process() as necessary to test functionality. To allow this to work, any main function in your submission will be automatically removed.
  • Don’t directly use ncurses or standard I/O functions such as printf(). AMS is looking for a ZDK screen.
.