Robots Docs
Fall 2025
API

# Wall

o1.robots.Wall
object Wall extends Square

The singleton object `Wall` represents walls, that is, squares that constitute unpassable barriers for robots. A robot can never be in the same location with a wall.

Since all wall locations in all robot worlds are alike and immutable, it is enough to have a single `Wall` object that can be placed anywhere in any robot world. There is no need for separate instances for each wall square.

## Attributes

Graph
Supertypes
  trait Square
  class Object
  trait Matchable
  class Any
Self type
  Wall.type

## Members list

### Value members

#### Concrete methods

def addRobot(`arrivee`: RobotBody): Boolean

Since this square is a wall, this method fails to add the given robot to the square. Instead, the robot collides with the wall and gets destroyed.

Since this square is a wall, this method fails to add the given robot to the square. Instead, the robot collides with the wall and gets destroyed.

## Parameters

arrivee

  the robot attempting to arrive in the square

## Attributes

Returns

  `false` since the robot’s arrival failed

def clear(): Unit

Does nothing, since there is no robot to remove in a wall square.

Does nothing, since there is no robot to remove in a wall square.

## Attributes

#### Inherited methods

def nonEmpty: Boolean

Returns `true` if the square contains any robot or wall, `false` otherwise.

Returns `true` if the square contains any robot or wall, `false` otherwise.

## Attributes

Inherited from:
  Square

#### Concrete fields

val isEmpty: Boolean

`false` since there is a wall

`false` since there is a wall

## Attributes

val isUnpassable: Boolean

`true` since a wall is an unpassable barrier

`true` since a wall is an unpassable barrier

## Attributes

val robot: Option[RobotBody]

`None` since there is never any robot in a wall square

`None` since there is never any robot in a wall square

## Attributes