JJoeven

Exercises / multiagent

Hop cap and cycles

next_hop(path, nxt, max_hops=3) appends nxt unless nxt is already in path (cannot: cycle) or len(path) >= max_hops (cannot: max hops). Print three calls.

Live Pythonpython
Output
Run to execute this in your browser. Nothing is sent to a server.