def display_score(screen, world): screen.move(2,1) screen.clrtoeol() fmt = 'Score: %3d Collected: %2d Water: %2d Flooding: %2d Waterproof: %2d Underwater: %2d Razors: %2d Growth: %2d %s' s = fmt % (world.score(), world.lambdas_collected, world.water, world.flooding, world.waterproof, world.underwater, world.num_razors, world.beard_growth, world.valid_moves()) screen.addstr(s) screen.refresh()
def on_best(planner, world): global best print >> sys.stderr, "Got new best world:", world.score() print >> sys.stderr, world ascope.best = planner.best.key