# Pentobi

## Overview

Pentobi is a computer opponent for the board game Blokus. In this game, four players place pieces similar to the pieces of the computer game Tetris on a 20×20 board. Pentobi also supports the game variants for two or three players and the game variants Duo, Trigon, Junior, Nexos, GembloQ and Callisto.

## Classic Rules

There are four players, Blue, Yellow, Red and Green, and a board consisting of 20×20 squares. Each player has a set of 21 pieces of his color shaped like the polyominoes up to size five. A polyomino is a shape built from a number of squares connected along the edges.

The players alternate in placing one of their pieces on the board. The first piece of a player must cover its starting square. The starting squares are located in the corners of the board.

The following pieces must be placed on empty squares such that the new piece touches at least one piece of its own color corner-to-corner but does not touch any piece of its own color along the edges. The new piece may touch edges of pieces of the opponent colors.

When the player of a color cannot place any more pieces, the player passes and the next color continues. When none of the players can place any more pieces, the player with the highest score wins. The score of a color is the number of squares on the board occupied by the color, plus a bonus of 15 points if the color could place all of its pieces, plus an additional bonus of 5 points if the color could place all pieces and the last piece played was the one-square piece.

### Rules for Two Players

The game can be played with two players. The first player plays both Blue and Red, the second player Yellow and Green. The points of both colors played by a player are added up.

### Rules for Three Players

The game can also be played with three players. The players take turns playing the fourth color (Green). At the end of the game, the score of Green is ignored.

### Colorless Starting Points

Note that the original Blokus Classic rules used colorless starting points. This means that each color may freely choose, which of the remaining unoccupied starting points to use for its first move. Pentobi currently only supports the rule variant with colored starting points because this rule variant was used at the first Blokus online servers and Blokus tournaments.

## Duo Rules

The game variant Duo is another game variant for two players. The game is played on a smaller board with 14×14 squares. There is only one color per player (Purple and Orange) and the starting squares are not in the corners, but on the square with the coordinates (5,10) for Purple, and on (10,5) for Orange.

## Trigon Rules

Trigon is another game variant. The rules a similar to game variant Classic but it uses a differently shaped board and a different set of pieces. Each color uses 22 pieces that are shaped like the polyiamonds up to size six. A polyiamond is a shape built from a number of equilateral triangles connected along the edges.

The board also consists of triangles and is shaped like a hexagon with an edge size of nine triangles.

There are six starting points on the board, each located in the middle of the fourth row away from each edge. The starting points are not colored and the players may freely choose a starting point for the first piece of a color.

### Rules for Two Players

Like game variant Classic, Trigon can be played with two players by having one player play Blue and Red and the other player Yellow and Green.

### Rules for Three Players

Trigon can be played with three players using the same rules as for the four-player variant. The three-player variant is played on a smaller board with an edge size of eight triangles. The starting points are located in the middle of the third row away from each edge.

## Junior Rules

Junior is a simplified game variant for two players. It is played on the same 14×14 board as game variant Duo but uses only a subset of the polyominoes up to size five and the players get two of each of those polyominoes.

Bonus points are not used in Junior.

## Nexos Rules

Nexos is a board game similar to Blokus. The board is a rectangular 13×13 line grid. Each color uses 24 pieces that consist of up to four connected line segments.

Each color has a starting intersection on the intersection of the third lines close to a corner. The first piece must touch the starting intersection.

The following pieces must be placed on empty line segments such that a segment of the new piece touches an intersection that is already touched by a segment of the same color. It does not matter if pieces of other colors touch or cover the same intersection. However, pieces may not overlap. The junctions between the segments within a piece are such that two rectangular junctions of different pieces can cover the same intersection without overlapping, but straight junctions cannot.

The score of a color is the number of line segments on the board covered by the color, plus a bonus of 10 points if the color could place all of its pieces.

### Rules for Two Players

Like Blokus, Nexos can be played with two players by having one player play Blue and Red and the other player Yellow and Green.

## GembloQ Rules

GembloQ is a board game similar to Blokus. The squares of the board are rotated by 45 degrees. The board has a diagonal size of 27 squares. In addition to the full squares, the edges also contain half squares such that the edges are straight lines.

Each player has a set of 21 pieces, which include a subset of the pieces used in Blokus, but also some pieces that contain a half square.

As in Blokus, the starting squares are in the corners, the first move must fully cover the starting square of the color and subsequent moves must touch a piece of the player color at a vertex, but not edge-to-edge. Moves are also legal, if a vertex of a half square touches an edge of a piece of the same color.

Scoring is done like in Blokus, half squares count 0.5 points. Bonus points are not used. Tie breaking by assigning additional values to the pieces, as described in the official GembloQ rules, is currently not supported by Pentobi.

### Rules for Two and Three Players

The game variants for two and three players use smaller boards and different starting point locations. In addition to the standard two-player variant, Pentobi also supports a game variant for two players like in Blokus, in which each player plays two colors.

## Callisto Rules

Callisto is a another board game similar to Blokus. The board is derived from the classic 20×20 Blokus board by removing the corners such that an octagon with a top edge of size six remains. The pieces are a subset of the polyominoes up to size five. They include three 1×1 pieces per player that play a special role.

The 1×1 pieces may be placed anywhere on the board apart from the center of the board. The center consists of an octagon with width six and top edge size two. The first two moves of a player must use a 1×1 piece, the third 1×1 piece may be played anytime later.

All larger pieces may be placed anywhere on the board but must touch an existing piece of the same color edge-to-edge.

The score of a color is the number of squares on the board occupied by the color not counting 1×1 pieces. Bonus points are not used. Unlike in Blokus, ties are broken in favor of the player who started later.

### Rules for Two and Three Players

The game can be played with less than four players by using a smaller board. For three players, the board is an octagon with width 20 and top edge size two. For two players, the board is an octagon with width 17 and top edge size two. The size of the center stays the same. In addition to the standard two-player variant, Pentobi also supports a game variant for two players like in Blokus, in which each player plays two colors.

## How to Use Pentobi

### Board

Pieces can be selected by clicking on one of the unplayed pieces or by using shortcut keys. Pieces can be played by dragging them to a place that corresponds to a legal move with the mouse or arrow keys and pressing the left mouse button or the Enter key.

Played pieces on the board can have numbers on them that indicate the move number in which the piece was played. A letter after the move number indicates that there exists a variation to this move (see below).

The score display shows the current points for each color or player. The points are the sum of on-board points and bonus points. Points are underlined if they are final because the color cannot play more pieces. A small star indicates that the points include a bonus.

### Playing Against the Computer

The board can be used for creating game records of games played by humans or for playing games against the computer. In games against the computer, the computer can play any (or several) of the colors.

When you start a new game, the human will play the color(s) of the first player by default and the computer all other colors. To change this, use Settings from the Computer menu or toolbar and select the colors the computer should play.

The exception is that the computer will play no color by default if it played no color in the previous game. This prevents the computer from automatically starting to play if the user mainly wants to use the board for entering move sequences or similar editing tasks. After loading a saved game, the computer also plays no color by default.

Selecting Play from the Computer menu or the toolbar always makes the computer play a move for the current color. If the computer did not already play this color before, it will also make the computer play this color (and only this color) from now on.

### Move Variations and the Game Tree

When you play a game, Pentobi will store the sequence of moves and it is always possible to go back to a previous position and play differently. If you do this, the new sequence is stored as an alternative sequence (called variation). Variations can also be used by annotators for commenting on existing games. Variations can exist at any board position and can have subvariations themselves. The game can therefore become a game tree, in which each node represents a board position. You can navigate in the game tree with the items in the Go menu and the navigation buttons.

The main variation is the sequence of moves that starts at the start position and always selects the first child node in each position (e.g. by pressing the forward button). The main variation is supposed to represent the real game played. If you want a side variation to become the main variation, select Make Main Variation from the Edit menu.

## Become a Stronger Player

Pentobi has functionality that can help you to become a stronger Blokus player.

### Game Analysis

A game can be analyzed by selecting Analyze Game from the Tools menu. This will make the computer player evaluate each position in the main variation. The result is displayed in a window with a diagram of colored dots.

Each dot represents a game position in which the color of the dot was to play. The dots are ordered horizontally by move number. The vertical axis represents the estimated probability of winning the game for the color to play. Mouse clicks in the diagram will go to the corresponding position.

The position values are only estimates and the computer will sometimes evaluate positions incorrectly. But sudden drops in the value can help you find moves that were potentially bad. You can go back to the position before the move and try to find a better move or ask the computer what it would have played by selecting Play Single Move from the Computer menu.

### Determine Your Rating

You can track your progress by playing rated games against the computer. The game results are used to determine your current rating. The rating is a number that represents your playing strength.

A rated game is started with Rated Game from the Game menu or the toolbar. If you have not played any rated games in the current game variant, you will be asked to choose a start value, which can reduce the number of games needed for determining your real rating. If you are a beginner, leave the start value at 800.

For each rated game, the computer will choose a playing level for the computer opponent according to your current rating. The color you play will be randomly chosen in each game.

During a rated game, most of the functions not needed for playing are disabled: you cannot undo moves, navigate in the game, change the computer colors or change the playing level. To get an accurate rating, you should always play rated games until the end.

After the game has ended, your rating will be updated depending on the game result and the computer level. For the game result, it only matters whether the game was won, lost or a tie. The exact number of score points does not matter.

You can always see your current rating by selecting Rating from the Tools menu. This will open a window that shows the development of your rating during the last 50 games as a graph. The last 50 games are automatically saved and can be loaded by opening a context menu in the game table below the graph.

## Window Menu and Toolbar

### Navigation Buttons in Toolbar

Beginning

- Go to the beginning of the game.

Backward 10

- Go ten moves backward in the current variation. The button supports autorepeat if pressed and held.

Backward

- Go one move backward in the current variation. The button supports autorepeat if pressed and held.

Forward

- Go one move forward in the current variation. If the current position has several follow-up variations (i.e. the current node in the game tree has several child nodes), the first variation will be used. The button supports autorepeat if pressed and held.

Forward 10

- Go ten moves forward in the current variation. If a position has several follow-up variations (i.e. the current node in the game tree has several child nodes), the first variation will be used. The button supports autorepeat if pressed and held.

End

- Go to the end of the current variation. Like Forward, this also uses the first variation in positions with several follow-up variations.

Next Variation

- Go to the next variation to the last move played (i.e. the next sibling node of the current node in the game tree).

Previous Variation

- Go to the previous variation to the last move played (i.e. the previous sibling node of the current node in the game tree).

### Game Menu

New

(Ctrl+N)

- Start a new game.

Rated Game

(Ctrl+Shift+N)

- Start a new rated game against the computer.

Game Variant

- Select a game variant and start a new game of this game variant.

Game Info

(Ctrl+I)

- Display or edit additional information about the game like the name of the players or the date when the game was played.

Undo Move

- Undo the last move played and remove it from the game tree. Undoing a move is only possible if it is the last move in the current variation (i.e. a leaf node in the game tree; use Edit/Truncate to remove inner nodes of the game tree).

Find Move

(Ctrl+H)

- Find a legal move for the current color and display it for a few seconds on the board. Selecting this item repeatedly will show all legal moves.

Open

(Ctrl+O)

- Load a saved game. The board position after loading will be the last position in the main variation unless the game starts with a setup position. If the game starts with a setup, the board position will be the first position instead. This avoids that solutions are immediately shown if the file contains a Blokus puzzle as a setup with the solution as the main variation.

Open Recent

- Load a recently used game.

Open Clipboard

- Open a game from a text copied to the clipboard. The text must be a valid game in Pentobi SGF file format.

Save

(Ctrl+S)

- Save the current game.

Save As

(Ctrl+Shift+S)

- Save the current game under a new file name.

Export/Image

- Save the current position as an image file. Several image file formats are supported, the file format is derived from the file name ending (e.g. ".png" for the PNG format). For a crisp image, the image width should be an integer multiple of the number of board columns in the current game variant.

Export/ASCII Art

- Save the current position as a text diagram. The text diagram should be viewed using a monospace font.

Quit

(Ctrl+Q)

- Quit Pentobi.

### Go Menu

Move Number

(Ctrl+G)

- Go to the move with a given move number in the current variation.

Main Variation

(Ctrl+M)

- Go back to the last position in the current variation that belonged to the main variation.

Beginning of Branch

(Ctrl+B)

- Go back to the last position in the current variation that had an alternative move.

Next Comment

(Ctrl+E)

- Go to the next position that has a comment. If the comment text field was not visible, it will become visible. Selecting this item repeatedly will show all positions with comments in the game tree.

### Edit Menu

Annotation

- Add a chess-style annotation symbol (e.g. ‼) to the current move. The symbols are appended to the move numbers in the status bar and, depending on the configuration of Move Marking, on the board.

Make Main Variation

- Make the current variation the main variation of the game. This reorders the nodes in the game tree such that the current variation becomes the main variation.

Variation Up

- Changes the order of variations such that the current position will appear earlier when iterating over the variations with Next Variation /Previous Variation.

Variation Down

- Changes the order of variations such that the current position will appear later when iterating over the variations with Next Variation /Previous Variation.

Delete Variations

- Delete all variations but the main variation. If the current position is not in the main variation, it will first be changed to a position as in Back to Main Variation.

Truncate

- Remove the node with the current position, including any subtree, from the game tree.

Truncate Children

- Remove all child nodes of the node with the current position from the game tree.

Keep Position

- Delete all moves and keep only the current position as a setup. This can be used to create files that start with a given fixed position.

Keep Subtree

- Like Keep Position but does not delete the moves after the current position.

Setup Mode

- Enter or leave setup mode. In setup mode, pieces can be placed anywhere on the board, even in violation of the game rules. Existing pieces can be removed from the board by clicking on them. The currently selected color also determines the color to play after the setup is finished. It can be changed with Next Color or by clicking on the orientation selector while no piece is selected. Setup mode can only be used if no moves have been played yet.

Next Color

- Choose the next color for selecting pieces. This can be used for example to enter game records, in which moves of a color were skipped because the color ran out of time.

### View Menu

Appearance

- Coordinates

- Display coordinates around the board for the fields on the board. The convention for the coordinates is the same as in the Blokus SGF file format used by Pentobi.

Show variations

- Appends a letter to the move number on the board if the move has variations. If moves are marked with dots instead of numbers, a circle will be used instead of a dot for moves not in the main variation.

Move number

- This option exists only in desktop mode and shows the move number, move annotation and variation information at the right side of the status bar.

Animations

- Enables or disables the piece rotation, flipping and placement animations.

Color theme

- Changes the colors of the window, board and pieces.

Move marking

- Change the way moves are marked on the board. The options are to mark the last move played with a dot or with a number, or to show the numbers of all moves, or not to show any marks.

Show comment

- This option exists only in desktop mode and configures the visibility of the comment area when the position changes. By default, the comment area is only shown if a comment exists for the current position.

Comment

(Ctrl+T)

- Toggle the visibility of the comment area in the current position.

Fullscreen

(F11)

- Make the main window full screen or leave full screen mode. To leave fullscreen mode without using the window menu, press the F11 key.

### Computer Menu

Settings

(Ctrl+U)

- Select which colors are played by the computer and the playing strength for the computer. Higher levels are stronger but can make the computer take a long time for playing moves on slow computers.

Play

(Ctrl+L)

- Make the computer play a move for the current color. This can be used to change the color the computer plays or to resume playing after navigating in the game tree. If the computer did not already play the current color, it will play this color (and only this color) from now on.

Play Move

(Ctrl+Shift+L)

- Make the computer play a single move for the current color without changing the colors played by the computer.

Stop

- Abort the current move generation. You can make the computer continue to play by selecting Play.

### Tools Menu

Rating

- Show a dialog window with the rating of the user in the current game variant.

Clear Rating

- Deletes the rating information and history for the current game variant.

Analyze Game

- Perform a game analysis.

Clear Analysis

- Deletes the analysis for the current game.

### Help Menu

Pentobi Help

(F1)

- Show a window to browse the Pentobi user manual.

About Pentobi

- Show an info dialog with information about this version of Pentobi.

## Keyboard Shortcuts

In addition to the shortcut keys, which are shown in the window menu, the following shortcut keys are supported by Pentobi. Note that these shortcuts are not active when the comment text field has the focus. In this case, the focus can be switched away from the comment text with the Tab key.

Plus

- Select next piece

Minus

- Select previous piece

Escape

- Clear selected piece

Left

Right

Up

Down

Shift+Left

Shift+Right

Shift+Up

Shift+Down

- Move the selected piece. The Shift key makes the piece move faster.

Space

- Next orientation of the selected piece

Shift+Space

- Previous orientation of the selected piece

Enter

- Play the selected piece

1

2

A

C

E

F

G

H

I

J

L

N

O

P

S

T

U

V

W

X

Y

Z

- Select piece according to commonly used piece names. If there are multiple pieces with the letter (e.g. I3, I4, I5), pressing the key several times cycles between them. Some letters are used only in certain game variants. For example, A is used only in Trigon for the pieces A6 and A4 (also known as "lobster" and "triangle").

Ctrl+Home

Ctrl+Shift+Left

Ctrl+Left

Ctrl+Right

Ctrl+Shift+Right

Ctrl+End

Ctrl+Up

Ctrl+Down

- Navigate in the game: beginning, ten moves backward, backward, forward, ten moves forward, end, previous variation, next variation.

Ctrl+Shift+H

- Like Find Move (Ctrl+H) but iterates backwards through the list of legal moves.

Ctrl+T

- Switch view between comment and game analysis.

Alt+M

- Open menu.

## System Requirements

Minimum: 1 GB RAM, 1 GHz CPU

Recommended for playing level 9: 4 GB RAM, 2.5 GHz dual-core or faster CPU

Pentobi will also work on systems that do not meet the minimum requirements but the highest playing level will be very slow on those systems (if the CPU is too slow) or have a reduced playing strength (if there is not enough memory).

## License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

### Trademark Disclaimer

The trademark Blokus and other trademarks referred to are property of their respective trademark holders. The trademark holders are not affiliated with the author of the program Pentobi.