Mark Horizontal Rows

  1. In the TETRIS game, when a horizontal row is filled up with tetrominoes so that there is no gap, this row 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 row 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. When you invoke update_occupy(), it should automatically invoke check_horizontal(i) for each row. If it returns true, mark the row(s) with a string "->".
    Mark the rows to be cleared
  6. Because the function check_horizontal() will only be invoked internally from update_occupy(), you may design it as a private member function in the class CTetromino.