import { Point2D } from "./Point2D" ; export const sortPossibleDirections = ( directions , sortFn ) => directions . map ( ( dir ) => ( { dir , score : sortFn ( dir ) } ) ) . sort ( ( a , b ) => b . score - a . score ) . map ( ( o ) => o . dir ) ;