Ryusei GamesClassic games in 3D

3D Four in a Row

Drop balls onto 16 rods set in a 4×4 grid. You win when you line up 4 of your balls vertically, horizontally, diagonally, or along a space diagonal of the cube. You can play against the computer, or send a link to play a friend.

Loading…

Rules and how to play

The 2 players take turns dropping 1 ball at a time onto any of the 16 rods set in a 4×4 grid. Balls stack up from the bottom of each rod, and each rod holds up to 4. You cannot place a ball partway up a rod, and you cannot drop a ball onto a rod that already holds 4. The first player is White, and the second player is Black.

You win when you get 4 of your balls in a straight line. The 4 balls can line up in the 5 ways below, for a total of 76 winning lines.

  • Vertically on the same rod (16 lines)
  • Straight across the same level, left to right or front to back (32 lines)
  • Diagonally from corner to corner on the same level (8 lines)
  • Diagonally across levels (16 lines). Each time the line rises 1 level, it moves 1 rod over, in either the left-right or the front-back direction
  • Along a space diagonal of the cube (4 lines). The line runs from level 1 of a corner rod to level 4 of the rod in the opposite corner
Examples of the 5 kinds of lines (the gold balls mark the 4 in a line; other balls are left out)

If all 64 balls are in and neither player has 4 in a row, the game is a draw.

Controls on this page

Choose how to play to the right of the board (below it on narrow screens). Under “Play vs computer”, press “Easy”, “Medium”, or “Hard”, and you start as the first player (White). To play as the second player (Black), press “Play second (Black) · Medium”. With “2 players on this device”, you take turns on a single device.

On desktop, click a rod to drop a ball onto it. When you hover the mouse over a rod, a translucent preview ball appears where the ball will go. On phones and tablets, tap a rod once to show the translucent preview ball, then tap the same rod again to drop the ball.

Drag the board to rotate the view. Use the mouse wheel or pinch with 2 fingers to zoom in and out. Switch views with the “Angled” and “Top-down” buttons at the top right of the board.

The 16 buttons to the right of the board (below it on narrow screens) are the 16 rods seen from above. In the starting view, the columns are A–D from the left, and the rows are 1–4 from the back. The 4 horizontal lines in each button are levels 1–4 from the bottom, and each level that holds a ball gets a white or black mark. Even when a ball at the back of the 3D board is hidden behind a ball in front, you can check it with these marks. Press a button to drop a ball onto that rod. Use these buttons when the 3D board is hard to touch, or when you play with a keyboard (select a button with the Tab key and press the Enter key).

During a game, “Undo move” takes back the last move. When you play against the computer, “Undo move” goes back to your previous turn. “Play again” starts over from the beginning, and “Change mode” takes you back to choosing how to play. When you play a friend, “Undo move” and “Play again” are not available.

The last ball dropped gets an orange ring on top. When 4 balls line up, those 4 balls turn gold, and the result appears a moment later. Close the result with “View board” to look at the board, and open it again with “Show result”.

Press “Play a friend (send a link)” to get a link for the game. Send it to your opponent with “Copy link” (or “Share” on devices that support it). The game starts when your opponent opens the link and presses “Join”. The host is the first player (White), and the player who joins is the second player (Black). After the game, press “Rematch (swap sides)” to keep playing the same opponent.

Strategy tips

Levels 1 and 4 of the 4 corner rods (8 cells) and levels 2 and 3 of the 4 center rods (8 cells) each lie on 7 winning lines. The other 48 cells each lie on 4. Taking many of the cells on 7 lines gives you more lines that you can use to win.[2]

Each level seen from above (the top of each grid is the far side)

A line in which 3 of the 4 cells hold balls of the same color and the remaining cell is empty is called a threat here. If the next ball dropped onto a rod would land exactly in the empty cell of your opponent’s threat, drop a ball onto that rod right away to block it.

When the cell directly below the empty cell of your opponent’s threat is empty, avoid moves that put a ball into that cell below. If you make such a move, your opponent drops a ball into the empty cell on the next move and wins.

Suppose you make 2 threats at the same time whose empty cells are on different rods, and on each of those rods the next ball would land exactly in the empty cell. Your opponent can then block only one of them with 1 move. Unless your opponent lines up 4 with that move, you can win on your next move by dropping a ball into the empty cell of the other threat.

Each rod has 4 levels, so if the second player (Black) always drops a ball onto the same rod as the first player (White), every rod fills up White, Black, White, Black from the bottom, and levels 2 and 4 become the second player’s cells. For this reason, the second player gains an advantage by making threats whose empty cell is on level 2 or 4. The first player aims for lines on level 1 or 3, which the second player cannot block just by stacking a ball on the first player’s.

Origin and history of 3D Four in a Row

Games of lining up 4 in a 4×4×4 cube are played under 2 kinds of rules: rules that let you place a ball in any cell, and rules in which balls stack up from the bottom of rods, as on this page. The rules that let you place a ball in any cell have been studied in mathematics as one of the games that extend tic-tac-toe to a larger board and more dimensions.[1][3]

In tic-tac-toe, the flat 3×3 game ends in a draw when both players play correctly, and in the version that lines up 3 in a 3×3×3 cube, the first player can always win. The 4×4×4 version in which balls can be placed in any cell was sold commercially in the United States in 1980. The version in which balls stack up from the bottom of rods, as on this page, was also sold commercially in the United States. According to the record of a trademark registered in 1968, it went on sale in August 1967.[1][4]

Under the rules that let you place a ball in any cell, the first player can always win with correct play. In the United States, Oren Patashnik showed this with a computer in 1977 and published it as a paper in 1980. The computation took about 1,500 hours on a computer at Yale University, and Ken Thompson of Bell Labs checked the result with a separate program. In 1992, Victor Allis of the Netherlands and his colleagues solved it again with a different search method.[1][2]

Under the rules on this page, where balls stack up from the bottom of rods, the cells where you can place a ball depend on how the levels below have filled. For this reason, the result for the rules that let you place a ball in any cell does not carry over directly. Under these rules, it was not known as of 2020 whether the first player or the second player wins. In the same year, a study at the Technical University of Munich developed a search program for solving it.[3]

Sources

  1. Oren Patashnik, “Qubic: 4×4×4 Tic-Tac-Toe” (Mathematics Magazine, vol. 53, no. 4, 1980) (opens in a new tab)
  2. L. Victor Allis, “Searching for Solutions in Games and Artificial Intelligence” (PhD thesis, University of Limburg [now Maastricht University], 1994) (opens in a new tab)
  3. René Romen, “Towards Solving Connect Four 3D” (Technical University of Munich, 2020) (opens in a new tab)
  4. U.S. Patent and Trademark Office (USPTO), “U.S. Trademark Registration No. 858,232” (TSDR, 1968) (opens in a new tab)

Frequently asked questions

How is it different from four in a row on a flat board?

In four in a row on a flat board, you line up 4 vertically, horizontally, or diagonally on a single board. In 3D Four in a Row, lines within each of the 4 levels count, and so do 4 stacked on the same rod, diagonals across levels, and space diagonals of the cube. Together there are 76 winning lines.

Is there a winning strategy for 3D Four in a Row?

Under the rules on this page, where balls stack up from the bottom of rods, it wasn’t known as of 2020 whether the first player or the second player wins. For the 4×4×4 rules that let you place a ball in any cell, a paper published in 1980 showed that the first player can always win with correct play.

Can a game end in a draw?

Yes. If all 64 balls are in and neither player has 4 in a row, the game is a draw.

Can I choose how strong the computer is?

You can choose from 3 levels: Easy, Medium, and Hard. On Easy, the computer picks about 40% of its moves at random. On Hard, it spends up to about 1.5 seconds per move looking ahead. When you start as the second player (Black), the computer plays on Medium.

How do I play with a friend?

Press “Play a friend (send a link)” to get a link for the game. Send the link to your friend by email or a messaging app, and the game starts when they open it and press “Join”. The host is the first player (White), and the player who joins is the second player (Black). A room is deleted after 30 minutes with no one connected, or 24 hours after it was created.

Can I play on my phone?

You can play in the browser on phones, tablets, and desktop. It’s free, and you don’t need to sign up or install an app. On devices that can’t show 3D, you can drop balls with the 16 buttons that appear to the right of the board (below it on narrow screens).

Sending game statistics

Information such as the start and end of each game, whether connections in games with a friend succeeded, and 3D display failures is sent to this site’s servers. It is used to find out which games are played to the end and on which devices display or connection fails, so that bugs can be fixed and the games improved. To stop sending it, turn off the switch below.

What is sent

Game type, mode (vs computer, pass and play on one device, solo, or with a friend), computer level, game settings (the rules for Gomoku and Checkers, and the number of players for Ludo and Chinese Checkers), result, number of moves, game length range, whether connections in games with a friend succeeded and the number of reconnections, 3D display failures and rendering speed range, device type (whether it is a phone, and memory and CPU core ranges), and browser and OS type.

What is never sent

Room IDs, moves and board positions, Hit and Blow numbers, IP addresses, and GPU model names. Data is sent only to this site’s servers and is not passed to outside services. Records are deleted after 30 days.

How the records are handled, and what ads and analytics send to outside companies, is described in the privacy policy.