A Guido van Robot world file (with the .wld extension) defines the environment
where Guido lives and moves. It specifies the layout of streets and avenues, boundary and interior
walls, the placement of beepers, and Guido's starting position, orientation, and beeper-bag contents.
Guido's world is a two-dimensional grid of intersections called corners:
avenue number and a street number (e.g., 1st Avenue and 5th Street is corner 1 5). The lower-left corner of the world is 1st Avenue and 1st Street (1 1).N – North (facing up / towards higher street numbers)E – East (facing right / towards higher avenue numbers)S – South (facing down / towards lower street numbers)W – West (facing left / towards lower avenue numbers)
Every line in a .wld file specifies a component of Guido's world.
Robot, Wall, Beepers, Size) and compass directions (N, E, S, W) are case-insensitive.#). Trailing comments on a line following a statement are also supported.
The Robot statement positions Guido in the world, specifies the direction he is facing, and gives the initial number of beepers inside his beeper-bag.
Robot <avenue> <street> <direction> <beepers>
Parameters:
<avenue> – The starting avenue number (positive integer ≥ 1).<street> – The starting street number (positive integer ≥ 1).<direction> – Initial compass direction Guido is facing (N, E, S, or W).<beepers> – Number of beepers in Guido's beeper-bag (integer ≥ 0, or -1 for an unlimited bag).Rules:
Robot statement.Examples:
Robot 1 1 E 0 # Guido starts at 1st Ave & 1st St, facing East, with 0 beepers Robot 4 3 N 0 # Guido starts at 4th Ave & 3rd St, facing North, with 0 beepers Robot 1 5 E 4 # Guido starts at 1st Ave & 5th St, facing East, with 4 beepers Robot 1 2 N -1 # Guido starts at 1st Ave & 2nd St, facing North, with unlimited beepers
The Wall statement places interior walls that block Guido's path. If Guido attempts to move into a wall, an error shut-off occurs and the program terminates.
Wall <avenue> <street> <direction> [<length>]
Parameters:
<avenue> – The avenue number of the starting corner (integer ≥ 1).<street> – The street number of the starting corner (integer ≥ 1).<direction> – Specifies which side of the corner is blocked by the wall:
N – Horizontal wall to the North of the corner (between this street and the street above).S – Horizontal wall to the South of the corner (between this street and the street below).E – Vertical wall to the East of the corner (between this avenue and the avenue to the right).W – Vertical wall to the West of the corner (between this avenue and the avenue to the left).<length> (optional) – The length of the wall in blocks (integer ≥ 1). If omitted, the default length is 1 block.Wall Extension Rules:
N or S) always extend in the East direction for the specified length.E or W) always extend in the North direction for the specified length.Wall 3 7 N 4 is identical to Wall 3 8 S 4 (a 4-block horizontal wall between 7th and 8th Street, spanning from 3rd Ave to 6th Ave).Wall 2 4 E 3 is identical to Wall 3 4 W 3 (a 3-block vertical wall between 2nd and 3rd Avenue, spanning from 4th St to 6th St).Examples:
Wall 2 4 N # 1-block horizontal wall north of corner (2, 4) Wall 2 4 E # 1-block vertical wall east of corner (2, 4) Wall 4 4 N 2 # 2-block horizontal wall north of 4th Street, starting at 4th Ave and extending East Wall 7 3 E 6 # 6-block vertical wall east of 7th Avenue, starting at 3rd Street and extending North
The Beepers statement places one or more beepers at a specific corner in the world for Guido to pick up during execution.
Beepers <avenue> <street> <number_of_beepers>
Parameters:
<avenue> – The avenue number of the corner (integer ≥ 1).<street> – The street number of the corner (integer ≥ 1).<number_of_beepers> – Number of beepers placed at that intersection (positive integer ≥ 1).Examples:
Beepers 4 4 1 # Places 1 beeper at the corner of 4th Avenue and 4th Street Beepers 2 5 3 # Places 3 beepers at the corner of 2nd Avenue and 5th Street
| Statement | Syntax | Description |
|---|---|---|
Robot |
Robot <ave> <st> <dir> <beepers> |
Sets Guido's starting corner, facing direction (N, S, E, W), and beepers in bag. (Required, exactly one) |
Wall |
Wall <ave> <st> <dir> [<length>] |
Places a wall of length ≥ 1 (default 1) blocking movement in direction dir. Extends East (horizontal) or North (vertical). |
Beepers |
Beepers <ave> <st> <count> |
Places count beepers on corner (ave, st). |
maze.wld):
# ========================================== # Guido van Robot Example World # ========================================== # Place Guido at 1st Avenue and 5th Street, facing East with 1 beeper Robot 1 5 E 1 # Place beepers on corners Beepers 3 5 1 # Define maze walls Wall 2 4 N Wall 2 4 E Wall 3 4 E Wall 4 4 N 2 Wall 2 5 N Wall 2 6 E Wall 3 6 E Wall 4 5 N 2
Language Reference | Index | Lesson 1
Copyright © 2026 Stas Zytkiewicz, Jeffrey Elkner, Roger Frank.