import random import robots def random_walk(whoami, state): my_robots = state.robots_by_player[whoami] return ''.join( random.choice('ULDRP') for _ in range(len(my_robots)) ) if __name__ == '__main__': server = robots.Server() server.add_simple_bot(random_walk, 'Alice') server.run(debug=True)