Mark Horizontal Lines

  1. In the TETRIS game, when a horizontal line is filled up with tetrominoes so that there is no gap, this line can be removed.
  2. However, this is a complex procedure, so let us divide it into several smaller sub-tasks. This "Divide and Conquer" strategy will be very helpful for you to design a complicated algorithm.
  3. In our case, we shall design several functions which, when combined together, will clear a horizontal line when there is no gap.
  4. In this exercise, let us first design a function check_horizontal(int i), which will check whether all elements in the row occupied[i] are true.
  5. After you invoke update_occupy(), invoke check_horizontal(i) for each line. If it returns true, mark the line(s) with a string "->".
    Mark the lines to be cleared