Moving Q

Basic Requirements (60pt)

  1. Use the "ncurses" library to develop a program, which shows the character 'Q' at (10, 10).
  2. The user may use the keys h,j,k,l to move 'Q' to Left,Down,Up,Right.
  3. If the user types "q", the program terminates.
  4. The flowchart looks like the one below.

Advanced Requirements (40pt)

  1. (10pt) Allow users to use both uppercase 'H' and lowercase 'h' to do the same movement.
  2. (10pt) Users can use either arrow keys or HJKL to control the movement of 'Q'.
  3. (10pt) Users can also change the color of 'Q' by pressing '0'…'7'.
  4. (10pt) Depending on the window size when the user starts running this program, your program should not allow him/her to move the 'Q' outside of the window.