i = rand() % nType
as the type_id
of the new tetromino. Now you do that in two steps:
i = next_i;
next_i = rand() % nType;
next_i
, you knows the
type_id
of the next tetromino (its value is still randomly generated).
You may draw it at an appropriate corner to give the player
a hint.