Exemplo n.º 1
0
def print_game_status():
    print "game (printing board, top tiles only)"
    print_board(9,9,False)
    x,y = tw.chips_pos()
    print "game (Keys R:%d B:%d Y:%d G:%d)" % tw.get_keys()
    print "game (Boots Ice:%d Suction:%d Fire:%d Water:%d)" % tw.get_boots()
    print "game (Player: %d,%d)" % (x, y)
    print "game (Chips left: %d)" % tw.chips_needed()
Exemplo n.º 2
0
def verbose_agent():
    """print out lots of debug and then return a random direction"""
    print_board(9,9)
    x,y = tworld.chips_pos()
    print "Keys R:%d B:%d Y:%d G:%d" % tworld.get_keys()
    print "Boots Ice:%d Suction:%d Fire:%d Water:%d" % tworld.get_boots()
    print "(%d,%d)" % (x, y)
    print "Chips left: %d" % tworld.chips_needed()
    return random_move()
Exemplo n.º 3
0
 def produce_init( self, out, max_num ):
     """Produce intial state"""
     print >> out, """(:init"""
     print >> out, "(chips-left n%d)" % tw.chips_needed()
     print >> out, "(switched-walls-open n0)" 
     print >> out, "(has-keys red n%d)" % tw.get_keys()[0] 
     print >> out, "(has-keys blue n%d)" % tw.get_keys()[1]
     print >> out, "(has-keys yellow n%d)" % tw.get_keys()[2]
     print >> out, "(has-keys green n%d)" % tw.get_keys()[3]
     if tw.get_boots()[0]: # ICE
         print >> out, "(has-boots ice)"
     if tw.get_boots()[1]: # SUCTION
         print >> out, "(has-boots slide)"
     if tw.get_boots()[2]: # FIRE
         print >> out, "(has-boots fire)"
     if tw.get_boots()[3]: # WATER
         print >> out, "(has-boots water)"
     produce_succesors(out, max_num) 
     self.produce_predicates( out, 32, 32)
     print >> out, ")"