Klotski Puzzle Game (3-Horizontal 2-Vertical Student Edition)
Loading the math board and drawing, please wait…
In collections
Math Games with GeoGebra (GGB)
This GeoGebra applet demonstrates the classic Klotski sliding block puzzle, also known as the Chinese block puzzle. Using polygons and points, it constructs the game board, various sized blocks of different dimensions, and boundary walls. Users can drag the blocks around the board to find the optimal solution that moves the largest block to the exit point, while the system tracks and displays the total number of moves made. This example showcases how to use GeoGebra's interactive features, conditional visibility, and scripting to implement a complex logic puzzle game. The applet is designed for students and serves as an engaging tool for algorithmic thinking training, helping learners develop spatial reasoning, strategic planning, and problem-solving skills through hands-on interaction with the puzzle.
GeoGebra Commands & Parameters
Polygon({PA, PA + (2, 0), PA + (2, 2), PA + (0, 2)}) → blockAPolygon({P1, P1 + (1, 0), P1 + (1, 2), P1 + (0, 2)}) → block1Polygon({P2, P2 + (1, 0), P2 + (1, 2), P2 + (0, 2)}) → block2Polygon({P3, P3 + (2, 0), P3 + (2, 1), P3 + (0, 1)}) → block3Polygon({P4, P4 + (2, 0), P4 + (2, 1), P4 + (0, 1)}) → block4Polygon({P5, P5 + (2, 0), P5 + (2, 1), P5 + (0, 1)}) → block5Polygon({P6, P6 + (1, 0), P6 + (1, 1), P6 + (0, 1)}) → block6Polygon({(0, 0), (0, 5), (4, 5), (4, 0), (3, 0), (3, -0.5), (4.5, -0.5), (4.5, 5.5), (-0.5, 5.5), (-0.5, -0.5), (1, -0.5), (1, 0)}) → wallPolygon({P7, P7 + (1, 0), P7 + (1, 1), P7 + (0, 1)}) → block7Polygon({P8, P8 + (1, 0), P8 + (1, 1), P8 + (0, 1)}) → block8Polygon({P9, P9 + (1, 0), P9 + (1, 1), P9 + (0, 1)}) → block9Polygon({T1, T1 + (1, 0), T1 + (1, 1), T1 + (0, 1)}) → blank1Polygon({T2, T2 + (1, 0), T2 + (1, 1), T2 + (0, 1)}) → blank2Polygon({(1, 0), (1, -1), (3, -1), (3, 0)}) → goalCircle(A, 0.5) → cPoint(c) → BPolygon({(0.5, 0.2), (0.5, 4.8), (3.5, 4.8), (3.5, 0.2)}) → poly__rulePolygon({(-0.5, -0.5), (-0.5, 5.5), (4.5, 5.5), (4.5, -0.5)}) → maps
AI Drawing Prompt Reference
Draw a Klotski sliding block puzzle board. Construct a rectangular game area with boundary walls, containing one large 2x2 square block, two vertical 1x2 blocks, three horizontal 2x1 blocks, and four small 1x1 blocks. Place an exit gap at the bottom center of the wall, and draw a goal zone below the board. Add a circle with a point on it as a reference marker. Use semi-transparent polygons to indicate the movable region and outer boundary. The layout is top-down, with distinct colors for each block.
The prompt above was compiled from the original drawing commands and is for reference only.