IBM Research

PUZZLE   IBM-326

Jumping frog game

IBM Research · Ponder This · 2025-06

IBM Ponder This #326 · June 2025

This puzzle was suggested by Gyozo Nagy - thanks!

We play the following game on an N×N board: We control a frog that starts somewhere on the board. The cells of the board can be either white ("empty"), blue ("visited"), or red ("forbidden"). At the beginning of the game, the whole board is white except for a blue cell where the frog starts. On each step of the game, the frog moves to one of the eight adjacent cells. We denote the possible moves with the letters A, B,...,H clockwise around the current cell, such that A is a move to the cell directly to the right, B is a move to the cell below and to the right, and so on around the current location of the frog. To move to a cell, the following conditions must apply:

  1. The cell must be white.
  2. The next cell in the same direction (if it exists) can be red or white but not blue. If no cell exists in the same direction, this constraint can be ignored.

After the move is performed, the cell now containing the frog turns from white to blue.
In addition, the next cell in the same direction (the one that could not be blue), if it exists, becomes red (or remains red if it was already that color).

The goal of the game is to reach a state where only non-white cells remain on the board (the number of red or blue cells does not matter).

For example, in a 4x4 board starting from (0,0) (the top-left corner), performing the sequence of moves "ABHCDBEFDGH" results in a fully colored board with 4 red cells.

Your goal: Solve the game for a 20x20 board starting from (0,0). Give your solution as a string of letters as shown above.

A bonus "*" will be given for solving the game for a 10x10 board starting from (4,4).

Solution

Best opened after a real attempt

To be added.