def get_legal(state):
 feature = np.zeros((1, state.size, state.size))
 for (x, y) in state.get_legal_moves():
  feature[(0, x, y)] = 1
 return feature

def get_legal ( state ) : feature = np . zeros ( ( 1 , state . size , state . size ) ) for ( x , y ) in state . get_legal_moves ( ) : feature [ ( 0 , x , y ) ] = 1 return feature
zero at all illegal moves .