<p>Squares in the form of a matrix of n rows and m columns are displayed on a display unit. The pattern in each square in the matrix of n rows and m columns is changed on the display unit based on operation of an operating unit by the player, and then changing of the pattern in each square is stopped. Whether adjacent squares are linked in the stopped matrix of n rows and m columns is determined based on the pattern in each square, and whether there is a win is determined based on the number of linked squares. When the stopped squares in the matrix of n rows and m columns is a win, a play value is paid out based on the number of linked squares.</p>