def get_turns_since(state, maximum=8):
 planes = np.zeros((maximum, state.size, state.size))
 for x in range(state.size):
  for y in range(state.size):
   if (state.stone_ages[x][y] >= 0):
    planes[(min(state.stone_ages[x][y], (maximum - 1)), x, y)] = 1
 return planes

def get_turns_since ( state , maximum = 8 ) : planes = np . zeros ( ( maximum , state . size , state . size ) ) for x in range ( state . size ) : for y in range ( state . size ) : if ( state . stone_ages [ x ] [ y ] >= 0 ) : planes [ ( min ( state . stone_ages [ x ] [ y ] , ( maximum - 1 ) ) , x , y ) ] = 1 return planes
a feature encoding the age of the stone at each location up to maximum note: - the [maximum-1] plane is used for any stone with age greater than or equal to maximum - empty locations are all-zero features .