CREATIVE NOTES / CODING & PLAYFUL LEARNING
How Does One Extra Segment Bridge a Three-Tile Gap? Growth and Support in Apple Worm
The worm’s head is over the third square of the gap, with empty space below. The worm is still holding steady. One step right reaches the far bank, while one step up makes it fall. Why? Apple Worm, a game in Monica Arcade, uses a grid to represent body growth, occupied squares and falling. The portfolio’s editors look at these movements using the rules and rooms of the version on this site.
An apple lets the tail keep its old square
The worm starts with three segments. On an ordinary move, its head enters a neighbouring square and its old tail square becomes empty, so its length stays at three. When the head enters a square with an apple, the head takes its new square and all three previous segments stay put. The worm is now four segments long. In Three-tile gap, an apple sits at the edge of the left bank. The extra segment can stay farther to the left as the head approaches the gap.
Look below the tail as well as the head
In this grid puzzle, a rock immediately below any segment holds up the whole worm. The tail can do that job while the head hangs over empty space. If no segment has a rock directly underneath it, every body square moves down one row and the game checks the new position. The worm falls a row at a time until it finds support or reaches an outcome such as completing the room or falling off the board. That is how the game calculates positions.
Support passes from tail to head across the gap
In Three-tile gap, the four-segment worm can move across in a horizontal line after eating the apple. When the head reaches the third gap square, the head and two middle segments are over the gap. The fourth segment is still above the rock at the very edge of the left bank. One step right takes the tail off the left bank and puts the head above a rock on the right bank at the same time. The left bank supports the tail, then the right bank supports the head. Trace the four body squares with a finger to see which segment has support at each step.
The extra body segment also needs room
A longer body gives the worm more squares that could find support, and more segments to fit into the available space. A move cannot go ahead if the head would enter a rock or a square that the body will still occupy on that move. In Low wall, a step right just before the wall is blocked. The worm can move its head up one square while lower segments stay supported, then move right onto the top of the wall. Ask two questions as you compare the moves. Can the head enter the next square? Which part of the body will have support afterwards?
Why does moving up cause a fall? Try it on paper
Draw rocks for the two banks and leave a gap three squares wide. Draw the four-segment worm horizontally, with its tail on the left bank and its head over the third gap square. Now try moving the head one square up. Draw the new head, keep the three segments that follow it, and erase the old tail square. The old tail was the only supported segment. Once it is gone, all four segments are above the gap. The head moved up, yet the whole worm now falls. Start from the same drawing and try moving right instead. Circle the new point of support. The two sketches show why the moves have different outcomes.
Two more questions
How can the worm stay in place with its head over empty space?
Any segment can provide support. If a rock is immediately below one segment, the whole body can stay in place. In Three-tile gap, the left bank supports the tail, and on the next step the right bank supports the head.
Does reaching the exit finish the room?
The worm must eat every apple in the room and bring its head to the exit square. When planning a route, take account of any apples that remain.
Explore the project
Prepared by the portfolio editorial team from the project rules and existing code, with AI assistance on the Chinese and English editions. The play exercises and rule analysis are editorial.