Initialization
Agent
agent.go(agent.adjacent().random());
Current world:

Help

Percepts
agent.breeze()Pit nearby
agent.stench()Wumpus nearby
agent.gold()Agent carries gold
Actions
agent.go(square)Go to square (where square must be adjacent)
Bottom left square: a0
agent.stepback()Return to previous square
Tools
agent.adjacent()Returns array of adjacent squares to current location (i.e. valid actions)
agent.adjacent(square)Returns array of adjacent squares to square
array.filter(fun)Returns array of elements matching fun predicate, e.g.
                [1, 2, 3].filter(function(el) { return el >= 2 })
              
array.each(fun)Applies fun to every element of array, e.g.
                [1, 2, 3].each(function(el) { alert(el) })
              
array.random()Returns random element from array, e.g.
                agent.go(agent.adjacent().random())
              
array.lengthNumber of elements in the array
Sets
mySet = set();Initializes a set in variable mySet
mySet.add(element);Adds element to the set mySet
mySet.contains(element);Returns true if mySet contains element