Abstract
San Jego is a two-player game with perfect information. It is a variation of the games Clobber (2001) and Cannibal Clobber. Given is a rectangular board with black and white pieces on the cells. Multiple pieces which are stacked on each other are called towers. The piece on top of a tower indicates her owner. A move consists of picking an own tower and placing it completely on top of an adjacent tower. If both players can not move anymore, the game ends. Winner is the player with the highest tower. An upper bound for the state-space complexity of San Jego is determined. Furthermore, the game-tree complexity is approximated theoretically and numerically. For small board sizes, the optimal game-theoretic values are calculated and the advantage of the first move is determined.
Introduction
San Jego is a two-player game with perfect information. It was designed by Althöfer (2015). The game is played on a rectangular board with
The players move alternatingly. In each move the player chooses one of her towers. A tower belongs to the player who has the top piece. This tower will be completely moved on top of a directly neighboring tower. The neighborhood is given by the four directions North, East, South, and West. Thus, each tower has at most four neighbors. It is not allowed to move a tower to an empty cell. If one player can not move any more, the other player has to make all her remaining moves. The game ends when neither of the players can move any more. The player with the highest tower wins the game. The value of the game is given by the height difference of the highest towers of the players. The game ends in a draw, if the highest towers of Black and White have the same height.
In Fig. 1, the rules are illustrated for the
(Cannibal) Clobber and San Jego are played on the same board, with the same pieces and same start configuration. One of the main differences between (Cannibal) Clobber and San Jego is the execution of the moves. In San Jego, the pieces are stacked to towers, while the pieces clobb each other in (Cannibal) Clobber. The condition of win also differs. In (Cannibal) Clobber the player who can not move any more loses the game instantly by fixed margin 1. On the other side, in San Jego the difference of height between the highest towers decides on win, loss or draw.

A San Jego game on the
The paper is organized as follows. In Section 2, the state-space complexity and game-tree complexity of San Jego are determined. These complexities are compared with the complexities of the related games Clobber and Cannibal Clobber. Section 3 contains the optimal game values for small board sizes and different starting positions. These results were calculated with a customized NegaScout algorithm. The paper concludes with a summary, discussion and ideas for new variants in Section 4.
There exist two common ways to measure the complexity of games. These are the state-space complexity and the game-tree complexity.
State-space complexity
The state-space complexity is the number of all game positions which can be reached from the starting position. Not all possible game positions can be reached from the starting position. Thus, the calculation of the exact state-space complexity is typically very difficult or practically impossible. However, the number of all possible game positions is an upper bound. The following theorem provides an upper bound of the state-space complexity of San Jego.
For the
In Equation (1), the sum symbol considers all game positions with at least one tower and at most The first binomial coefficient describes the number of possibilities to assign the The second binomial coefficient indicates the number of possibilities to distribute k towers onto Three comments on Equation (1) of Theorem 1:
If If San Jego is a 3 dimensional game: The board has two dimensions, and the towers give dimension 3. Consequently, it is natural to consider all pieces and their colors to characterize a tower. An alternative approach would be the characterization of a tower only by its height and top color. In this case,
The second complexity measure is the game-tree complexity. This represents the number of leafs in the game tree and corresponds to the number of playable games. In the sequel, the game-tree complexity is approximated by multiplying the average numbers of moves for all levels in the game tree. The calculation of these average move numbers is based on the following heuristic modeling as a branching process. A game position is called random with parameter
Assume a random game position for the
The proof is presented only for Assume without loss of generality that Black is to move. First, the average number of legal moves is calculated for an arbitrary cell The first case concerns edge cells which are not corners. Let Based on these The remaining two cases (corners and inner cells) are analyzed analogously. Details are skipped here. Altogether, the expected number of legal moves for an arbitrary cell Equation (2) is used to calculate the expected number of legal moves for the complete board. Let The first equality of Equation (3) holds because of the linearity of expectation values. After the second equal sign, the cells are grouped in the three categories corner, edge and inner cell. Further simplifications of Equation (3) lead to the result of the lemma. □
In the following, even and odd depths are discussed separately. For even depths and
Average number of legal moves as a function of the game tree depth
In all cases of Table 1, the exact value is smaller or equal than the value of Lemma 4. Consequently, Lemma 4 provides an upper bound for the average number of legal moves.
Assume
Let
Theorem 5 gives also a hint for an upper bound for the game-tree complexity of Cannibal Clobber.
In the sequel, the complexities of San Jego are compared with those of the related games Clobber and Cannibal Clobber. In the Computer Olympiads between 2005 and 2018, Clobber was played on
The data for the state-space complexity of San Jego is based on Theorem 1. For Cannibal Clobber, there exist at most
The state-space complexity of San Jego is smaller than the state-space complexity of Cannibal Clobber to the power of two. More precisely, we proved theoretically (cf. Appendix) that for arbitrary
For the approximation of the game-tree complexity we used two approaches. Besides the theoretic approach of Subsection 2.2, Monte-Carlo simulations (MC simulations) were executed. In each MC simulation,
State-space complexity for the games Clobber, Cannibal Clobber and San Jego
State-space complexity for the games Clobber, Cannibal Clobber and San Jego
The game-tree complexity of Cannibal Clobber is significantly larger than the game-tree complexity of Clobber. One reason is the larger number of legal moves and the associated increase of the game length. Between Cannibal Clobber and San Jego there is only a small increase of complexity. More precisely, they differ approximately by the multiplicative factor
Game-tree complexity for the games Clobber, Cannibal Clobber and San Jego
Random agents do not distinguish between good and bad moves. Consequently, the random games often end rather early, which underestimates the size of the game tree. Clobber is a good example for this phenomenon. Claessen (2011) let the strong program MILA play 400 times against itself. MILA is the program which had won the Clobber tournament of the ICGA 2005 event (Willemson and Winands, 2005). Based on his runs, he got an average game length of 46.3 and 71.6 for the
NegaScout algorithm
The NegaScout algorithm of Reinefeld (1983) was used to calculate the optimal game values for several given starting positions. This algorithm combines the classical Alpha-beta pruning with a null window search. The basic algorithm is well known, for that reason the details are skipped. Instead, two San Jego specific customizations are presented to improve the performance.
A two phase heuristic was used to sort the legal moves. In the first phase, moves with high enemy towers on the target cell are preferred. To the contrary, target cells with high own towers have the lowest priority. Often the preferences of Phase 1 do not give unique candidates. Here we had a tie-breaking Phase 2: a local weight is assigned to each cell. From center to border the weights are decreasing. For cells with the same preference after Phase 1 the move with the higher weight for the target cell is preferred.
Depending on the board size, the starting position is horizontally or vertically symmetric. So it is not necessary to consider all legal moves. For instance, for the
For the adapted NegaScout algorithm, the improvement of performance by move ordering is illustrated in Table 4. Just Phase 1 cuts off a large area of the game tree while only Phase 2 is not effective. However, combining both phases works very well. In comparison with the basic NegaScout algorithm with random move order, the number of visited end positions is reduced to approximately 2.2%.
Number of visited end positions for the customized NegaScout algorithm and the
board
Number of visited end positions for the customized NegaScout algorithm and the
For San Jego, it can matter whether Black or White begins. Thus, it makes sense to distinguish between seven possible outcomes for a specified board position. The outcomes are denoted by F, Z, D, B, F: first player win, B: Black win, W: White win, D: draw, Z: second player win (Z like Zugzwang),
The outcomes F, Z, D, B and W are independent of whether Black or White begins. For the outcomes
Assume m and n arbitrary but fixed. By reasons of symmetry it is enough to look at the outcomes for boards with
Figure 2 shows the outcomes for different small board sizes. For larger boards, the algorithm was not able to calculate the results in a reasonable amount of time. Even for the small
For boards with at least two rows, almost always the first player wins. The only two exceptions found are the

Game-theoretic results of San Jego for various board sizes.
Seven possible outcomes for a (basic) starting position were defined in Subsection 3.2. Here, our question is: What may happen for other starting positions? Exemplary answers are given for the
The game values for all starting positions with eight black and eight white pieces were calculated. From each symmetry class we included only one representant in the investigation. In total, 1,674 such starting positions exist for the
Approximately 60% of all these starting positions lead to a win for the starting player. However, for each of the other six outcomes (Z, D, B,

Classification of all fair and unique starting positions for the
Figure 3b shows the game values for all starting positions which do not end in a draw. For the classification with respect to the game values it does not matter if Black or White starts. Most of the starting positions are won by the first player with scores 1, 2, or 3. A win with game value 6 is the highest to occur. One of the two representatives can be found in Fig. 4b. There are only a few starting positions which can be won by the second player. The corresponding game values are relatively small, 3 being the maximal game value here (see the nice configuration in Fig. 4c).

Interesting starting positions.
Summary and discussion
San Jego is a new variant of Cannibal Clobber which itself is a variant of the semi-classic Clobber. The relation between San Jego and Cannibal Clobber is similar to the one between Emanuel Lasker’s “Lasca” and Checkers: In Lasca, also higher and higher towers of pieces are established during the course of the game (Lasker, 1931).
Whereas Clobber and Cannibal-Clobber are combinatorial games in the “traditional” sense, San Jego is different as the final score is not just win or loss, but a win by some margin. Unfortunately, the approach of Larsson et al. (2016, 2018) does not apply to San Jego as the final phase with moves by only one remaining active player is an essential part of San Jego.
We derived upper (and lower) bounds for the complexity of San Jego, in comparison with Clobber and Cannibal Clobber. The lower bounds are trivial in the sense that the complexities of Clobber and Cannibal Clobber on boards of the same size constitute these bounds.
We computed exact game-theoretic values for San Jego on small boards with the help of computer-based game tree search. Concerning slim boards, in particular with
On many small boards, the first player has a certain advantage. This finding is in agreement with our experience from many human test games. To make San Jego fair for play in practice, either pairs of games may be played with a change of colors after the first game, or a game may start with a komi bidding procedure where each players guesses the correct value to counterbalance an advantage for the side to move first.
For larger boards, computer analysis of San Jego may use versions of proof-number search (see Allis et al., 1994), table bases for “end games”, and more sophisticated heuristics in move ordering.
Open questions and new variants of San Jego
On human play
Experiments with dozens of human players during exhibitions in recent years indicate that “San Jego” as a game is much more suited for human play than Clobber or Cannibal Clobber. In particular, young people and children feel affected by stacking towers (for instance realized by LEGO® bricks or GeoMag™ sticks).
Footnotes
Acknowledgements
Appendix
Approximation of the central binomial coefficient via Stirling’s formula
| m | n | |
| 6 | 6 | 0.99308049 |
| 8 | 8 | 0.99610152 |
| 10 | 10 | 0.99750316 |
| 20 | 20 | 0.99937519 |
| 100 | 100 | 0.99997500 |
| 1000 | 1000 | 0.99999975 |
