Is there another dragon way to do this? I am trying to find eight neighbors of an integer coordination that is lying to an extent. I am interested in reducing its functionality without sacrificing the speed of execution.
Phf (8) PAE - 1), (PX - 1, PA), (PX - 1, PA + 1), (PX, PA - 1), (PX, PA + 1), (PX + 1, PA-1), (PX + 1, PA), (PX + 1, PA + 1)] F_Arange = [] For Fx, F in F: If Fx and LT; X1: Continue if Fx & gt; = X2: Continue if fy & lt; Y1: Continue if Fy> = Y2: Continue f_inrange.append ((fx, fy)) back f_inrange
Comments
Post a Comment