says that the robot is somewhere in two dimensions, within our 100,100 universe, and:
NORTH←0 1
SOUTH←0 ¯1
EAST←1 0
WEST←¯1 0
Now if these were all objects, we’d have to define move to apply a Direction to something with a Position, but in an array language, + is a perfectly good definition of that method:
ROBOT←ROBOT+NORTH+EAST
Of course, array programmers might not bother with these names. With the coordinate system in-mind they might simply
In an array language, we simply use vectors, so:
says that the robot is somewhere in two dimensions, within our 100,100 universe, and:
Now if these were all objects, we’d have to define move to apply a
Directionto something with aPosition, but in an array language,+is a perfectly good definition of that method:Of course, array programmers might not bother with these names. With the coordinate system in-mind they might simply