Function cetkaik_yhuap_move_candidates::absolute::same_direction
source · Expand description
Calculates the distance between two points. The distance is defined as the larger of the difference between either the x or y coordinates. /2点間の距離(x座標の差およびy座標の差のうち小さくない方)を計算する。
Examples:
use cetkaik_core::absolute::{same_direction, Coord};
use cetkaik_core::absolute::Row::*;
use cetkaik_core::absolute::Column::*;
assert_eq!(true, same_direction(Coord(IA, Z), Coord(A, Z), Coord(E, Z)));
assert_eq!(false, same_direction(Coord(IA, Z), Coord(A, P), Coord(E, Z)));
assert_eq!(false, same_direction(Coord(O, Z), Coord(A, Z), Coord(IA, Z)));