Preventing the game field from starting with successful streaks means coding all the required routines to see if a given gem is part of a successful streak. There is a lot to code, but the good news is the functions to check for successful streaks that we are about to write are the same as we will use when the player starts swapping gems.
The idea: When it's time to place a gem, check if the gem we are about to place will form a successful streak. In this case, keep generating random gems until it's no longer part of a streak. Finally place the gem.
The development: Checking for a successful streak is not different from checking for victory in Connect 4. We can even say it's easier since we only have to look horizontally and vertically, without caring about diagonals.
Following the concepts seen during the making of Connect 4, let's start creating some basic functions.
The first function we need is one that tells us if there is a certain gem in a given row and column...