Abstract
PuyoPuyo is one of the Tetris-type games, which is dealt with as a single-player game in this paper. The player has a winning strategy if the player can keep playing the game infinitely on a gameboard of a constant height. In this paper, we consider how lookahead of input pieces affects the existence of winning strategies in PuyoPuyo, and show conditions that the player cannot win even with lookahead. First, we show the number of colors sufficient to make the player lose on the gameboard of width w when the number of lookahead pieces is m. Next, we show that ten and twenty-six colors are sufficient to make the player lose on the gameboards of width two and three, respectively, no matter how large the number of lookahead pieces is.
Introduction
Tetris is one of the most popular video games, and many Tetris-type games have been developed. In Tetris-type games, the player manipulates the game pieces falling from the top of the gameboard and places them on the bottom of the gameboard or the other game pieces. Pieces disappear if the condition defined in each game is satisfied. The player loses when game pieces are piled up to the top of the gameboard. PuyoPuyo (also known as Puyo Pop) (SEGA, n.d.) is one of the Tetris-type games which is played worldwide. In PuyoPuyo, a piece consists of two puyos, each of which has a color. Puyos on the gameboard disappear when four or more puyos of the same color are connected. PuyoPuyo is remarkably different from Tetris (and related tiling problems, e.g., Merlini et al., 2002) at the point that two puyos in a piece are separated so that no blank cells exist below a puyo. Due to the characteristic, chain reactions may occur in PuyoPuyo, which makes it hard to analyze the game. We consider PuyoPuyo as a single-player game, though it is usually a two-player game. The single-player PuyoPuyo can be regarded as a two-player game played between the player and the adversary who gives inputs attempting to make the player lose.
On the complexity of Tetris-type games, several problems on Tetris and PuyoPuyo are proved to be NP-complete (Asif et al., 2019; Breukelaar et al., 2004; Demaine et al., 2017; Matsukane and Takenaga, 2006; Muta, 2005). Also, some (un)decidability results and constructibility of configurations are shown on Tetris in Hoogeboom and Kosters (2004a, 2004b). In the above intractability results, it is assumed that the whole sequence of input pieces is given in advance. However, the player cannot know the whole input in real games. The strategy of the player who cannot know the upcoming pieces is regarded as an online algorithm.
On the strategy of Tetris-type games, we consider that the player has a winning strategy if the player can play the game infinitely using a constant number of rows. That is, if the player does not have a winning strategy, the player cannot win for any gameboard of a fixed height.
Winning strategies of Tetris are shown for several subsets of game pieces, and the non-existence of a winning strategy is proved for some other subsets when input pieces are decided knowing how the previous pieces are placed (Brzustowski, 1992). This result was improved in Burgiel (1997) to show that there exists an input sequence for which the player has no winning strategy even if the player knows the input sequence. The strategy of Tetris is also discussed in Baccherini and Merlini (2007); Şimşek et al. (2016). On a game called Luminus, a condition that the player can keep playing forever is shown in Aloupis et al. (2007).
On PuyoPuyo, different from the other games mentioned above, the difficulty of the game changes according to the number of colors used in input pieces. Thus, the number of colors can be considered as a parameter. In Takenaga and Shimada (2016), conditions for the existence and non-existence of a winning strategy are studied on single-player PuyoPuyo when the width of the gameboard and the number of colors can be changed. The main results of Takenaga and Shimada (2016) are as follows.
When the number of colors of puyos is k, the player has a winning strategy if the width of the gameboard is greater than or equal to
On the gameboard with width w, the player can make no puyo disappear if the number of colors k satisfies the following:
In this paper, we consider how lookahead affects the existence of a winning strategy in single-player PuyoPuyo. Lookahead is advantageous to the player and the advantage becomes larger as the number of lookahead pieces increases. However, even with lookahead, the player cannot win if the number of colors is sufficiently large.
We first show the condition that the player loses using the number of lookahead pieces as an additional parameter. In this result, the adversary can choose the input according to the placements of previous pieces. The result also improves Theorem 2 when the number of lookahead pieces is zero. Second, we consider the case with infinite lookahead. In other words, the player knows the whole input sequence in advance. If the number of colors is too large, it seems that the player cannot win no matter how large the number of lookahead pieces is. In this paper, we show that ten and twenty-six colors are sufficient to make the player lose on the gameboards of width two and three, respectively.
The rest of the paper is organized as follows. In Section 2, we describe the rules of PuyoPuyo. In Section 3, we consider the case that the number of lookahead pieces is finite and show the number of colors sufficient to make the player lose. In Section 4, we deal with the case of infinite lookahead and show that the player loses on the gameboard of width two or three when the number of colors is sufficiently large. Section 5 concludes this paper.
In this section, we explain the rules of single-player PuyoPuyo with lookahead. The gameboard is a rectangular grid of width w. A puyo has a color and occupies one cell of the grid. Puyos appear on the gameboard as a piece which consists of two connected puyos. Pieces fall from the top of the gameboard one by one.
A piece can be moved horizontally and be rotated until one of the puyos reaches a cell just above the one already occupied by another puyo or a cell just above the bottom of the gameboard. When one of the puyos of a piece has reached the cell just above a puyo and there exist blank cells under the other puyo of the piece, the puyos of the piece are separated and the latter keeps falling. The separated puyos cannot be moved horizontally.
In addition to the piece falling on the gameboard, the player can see some pieces called lookahead pieces. The ith lookahead piece is the ith piece that appears after the piece on the gameboard is placed. The player can decide how to play considering the lookahead. When the player can see m lookahead pieces, just after the piece on the gameboard is placed, the first lookahead piece appears on the gameboard and the ith lookahead piece becomes the
Puyos of the same color which are placed on vertically or horizontally adjacent cells are called a block. If blocks with four or more puyos are made after a piece is placed, all the puyos in the blocks disappear. Just after blocks disappear, puyos placed above them fall down. New blocks with four or more puyos can be made by the fall, which causes a chain reaction. An example of the moves of PuyoPuyo with two lookahead pieces is shown in Fig. 1. In the figure, colors are represented by capital letters. Two lookahead pieces are shown on the right of the gameboard, the first lookahead piece is on the top and the second lookahead piece is on the bottom. A bold arrow means that a new piece appears on the gameboard in the next configuration.

An example of moves of PuyoPuyo. See main text for full explanation.
In this section, we consider the case that the player can see a finite number of lookahead pieces. In addition to the width of the gameboard and the number of colors, we take the number of lookahead pieces m as another parameter. The following theorem shows the number of colors sufficient to make the player lose.
On single-player PuyoPuyo with m lookahead pieces, when the width of the gameboard is w, the player can make no puyos disappear if the number of colors k satisfies the following:
We show how the adversary chooses the input pieces so that the player can make no puyos disappear. When When The colors that appear at the top of columns are not included in the falling and lookahead pieces. All the puyos in the falling and lookahead pieces have different colors. When no vertical connection exists, four puyos of the same color must be connected horizontally to make a block of size four. We consider how to prevent such horizontal connections. Divide the columns into intervals that consist of three consecutive columns Any puyo in the falling and lookahead pieces cannot be placed on a cell horizontally adjacent to the puyo of the same color that is on the other side of a border. An example to choose lookahead pieces ( If the heights of the columns on both sides of a border are different, by placing the falling piece and all the lookahead pieces on the lower column, Now we count the number of colors necessary to choose the mth lookahead piece satisfying the above conditions. To satisfy conditions i) and ii), as the number of colors on the top of columns is at most w and the number of colors used in the last m pieces is
Note that, from the latter condition, each piece consists of two puyos with different colors. If both conditions are satisfied, the piece falling on the gameboard does not include the colors that appear on the top of the columns. Thus, the conditions are sufficient to prevent the vertical connection of the same color.
Note that, as condition ii) is satisfied, no vertical connection can be made with two puyos in the falling or lookahead pieces.

In this section, we consider the situation that the player knows all the upcoming inputs, in other words, the number of lookahead pieces is infinite. When the width of the gameboard is one, two colors are sufficient to make the player lose as described in the previous section. We show the necessary number of colors to make the player lose for the cases of widths two and three.
Case of width two
First, we consider the case that the width of the gameboard is two. We can easily observe that at least two vertical connections exist in a block with four or more puyos. When three puyos of the same color are connected vertically, there exist two vertical connections.
The idea of the proofs is as follows. We consider an input sequence such that a subsequence is repeated infinitely. We first obtain an upper bound on the number of vertical connections that can be made using the puyos in the first t rounds of the subsequence. From the upper bound, we can compute an upper bound on the number of puyos that can disappear in t rounds. Finally, we show that the number of puyos that do not disappear and remain on the gameboard can be arbitrarily large as t increases, which means that the player loses.
We first assume that the number of colors is even. In the following, we represent colors by positive integers. A piece with puyos of colors i and j is represented as
When the width of the gameboard is two, at most
A pair of puyos with the same color placed in the same column can possibly make a vertical connection at some moment in the gameplay. Even if two puyos of the same color are not adjacent when they are placed, a vertical connection appears if all the puyos between them disappear. We consider the maximum number of pairs that can exist in the sequence of puyos placed in a column, all of which can possibly make vertical connections. In the following, when puyo a is placed below puyo b, we write That is, any two pairs
When any two pairs of puyos satisfy the above relations α or β, if puyos in the column are removed in an appropriate order, all the pairs of puyos make a vertical connection at some moment. Here, we do not consider if it is possible to remove the puyos in such a manner in gameplay. However, as the pairs of puyos that make vertical connections in gameplay must satisfy the above relations, the maximum number of such pairs upper bounds the number of vertical connections. To compute the maximum number of pairs made in a column, we assume that all the puyos in the input pieces are placed in a column. This is because any sequence of puyos placed in a column in gameplay using two columns is a subsequence of some placement of all the puyos in a column. The maximum number of pairs made in a sequence of puyos is obviously not smaller than that made in its subsequence. Therefore, the maximum number of pairs made in such a placement of puyos in t rounds is an upper bound on the number of vertical connections made in a column during the first t rounds. By doubling the upper bound, an upper bound of the total number of vertical connections in two columns is obtained. From here, to simplify the discussion, we consider pairs of pieces, not pairs of puyos, for a while. A pair of pieces consists of two pieces of the same colors. Remember that colors Let First, we consider the number of pieces necessary to make k pairs of pieces any two of which satisfy relation α. That is, there exist k pairs Conversely, we can show that k pairs of pieces can be made using any consecutive Until now, we have considered the case that any two pairs of pieces satisfy relation α. Now we consider the case that pairs may satisfy relation β. We show that if k pairs can be made using a set of consecutive pieces, k pairs such that any two of which satisfy relation α can be made using the same set of pieces. Assume that groups of r pairs and s pairs exist, both consisting of pairs that satisfy relation α as shown in the left side of Fig. 5. Also, assume that there exists no other pair on the set of pieces. To make r pairs and s pairs, We compute an upper bound on the number of pairs of pieces made from pieces of the first t rounds. In t rounds,
Consider a block with at least four puyos on the gameboard of width two. The ratio of the number puyos in a block to the number of vertical connections in the block is at most
In this proof, we consider only the puyos that constitute a block. Puyos in a block are placed in some consecutive rows. We can assume that a puyo exists in the left column of all the rows for the following reason. Consider a maximal series of consecutive rows such that puyos in a block exist only in the right column. If the row just above or just below them contains a puyo in the block only in the left column, the puyos do not constitute a block. Thus, the rows just above and below them are either a row with two puyos of the block or a row with no puyo of the block. Therefore, the number of vertical connections does not change by moving the puyos in the right column to the left column. An example is shown in Fig. 6. In this figure, only the puyos in the block are shown and the other cells are occupied by puyos of other colors or empty. Now we compute the minimum number of vertical connections necessary to make a block with m puyos. Let the block be positioned in h rows ( When there exists at least one vertical connection in the right column, there exist As there are
The positions of the two pairs are shown in Fig. 4.

An illegal position of two pairs.

Legal positions of two pairs.

Modify the pairs of pieces without reducing the number.

Move puyos to the left column.

A block with ratio

The situation that three puyos are vertically connected.
The next theorem is the main result of this section.
Consider the single-player PuyoPuyo on a gameboard of width two. When the number of colors is ten or larger, there exists an input sequence for which the player loses even when the player knows the whole input sequence.
First, consider an upper bound on the number of puyos that disappear in the first t rounds. From Lemma 5, it seems that the number is maximized if all the blocks disappear in the form of Fig. 7. However, two vertical connections are made with three puyos in this block. To produce a block of the form, the maximum number of vertical connections decreases by one. The reason is as follows. The three puyos in the vertical connections come from three different pieces with the same colors ( Assume that m blocks with the form of Fig. 7 disappear. Then, after the first t rounds, the number of vertical connections is at most As the total number of puyos in t rounds is
In this section, we apply the above method to the gameboard of width three. The input sequence is the same as the one considered in the case of width two. The only difference is that the number of vertical connections necessary to make a block disappear is one.
Consider a block with at least four puyos on the gameboard of width three. The ratio of the number of puyos in a block to the number of vertical connections in the block is at most 4, which is achieved when the number of puyos is four.
We consider only the puyos in a block. First, consider a maximal series of consecutive rows such that puyos in the block exist in the left and the right columns, and not in the middle column as shown in Fig. 9. Then, either the row just above them or the row just below them must include puyos in all the columns. Because otherwise, the puyos are not connected. Without loss of generality, we assume that the row just below them has three puyos. There exist four cases of the row just above the consecutive rows shown in Fig. 9, where the patterns symmetric to the ones in the list are omitted. In any case, by moving the puyos surrounded by a rectangle to the middle column, there exist no rows such that puyos exist only in the left and the right columns. The move keeps the connectivity of puyos without changing the number of vertical connections.
Next, consider a maximal series of consecutive rows such that puyos exist only in the left column. As in the proof of Lemma 5, in the rows just above or just below them, puyos exist both in the left and the middle column or no puyos exist in the row. Then the puyos in the left column can be moved to the middle column without changing the number of vertical connections. A similar discussion holds for the rows such that puyos exist only in the right column. After all the moves, each row in the block includes a puyo in the middle column.
Possible locations of puyos.
Now we fix the number of rows h which is used for the block and consider the maximum ratio when we change the number of puyos in the block. From the above discussion, we can assume that every row contains a puyo of the block in the middle column. When there is no vertical connection in the other columns, the ratio is maximized when m is the largest. As at most
If the number of puyos becomes larger, whenever we add a puyo to the left or the right column, the number of vertical connections increases at least by one. As
Consider the single-player PuyoPuyo on a gameboard of width three. When the number of colors is twenty-six or larger, there exists an input sequence for which the player loses even when the player knows the whole input sequence.
This theorem is proved similarly to Theorem 6. As the upper bound on the number of pairs of puyos obtained in the proof of Lemma 4 can be applied to each column, the total number of vertical connections is at most
In this paper, we have considered the limit of the power of lookahead in single-player PuyoPuyo. We have shown the number of colors sufficient to make the player lose for two cases. The first case is that the player can see m lookahead pieces, and the second case is that the player knows the whole input sequence and the width of the gameboard is two or three.
In the proof of the latter result, an upper bound on the number of vertical connections is considered. However, the upper bound seems not tight because, in many pairs, puyos in a pair cannot be vertically connected in the gameplay. Also, vertically connected puyos may not be made to disappear. Thus, it seems possible to reduce the number of colors necessary to make the player lose. However, it must require a very detailed analysis. To show similar results on the gameboard of width four or larger, we must be able to deal with blocks that disappear with no vertical connections.
Footnotes
Acknowledgements
This work was supported by JSPS KAKENHI Grant Number 18K11601.
We would like to thank anonymous reviewers for their invaluable comments.
