|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 327 (0x147) Types: TextFile Names: »idist.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Empire/idist.c«
#include <math.h> #define MAX(a,b) ((a > b) ? (a) : (b)) #define ABS(a) (((a) < 0) ? -(a) : (a)) /* * Return distance between location n1 and n2 */ idist_(n1p, n2p) int *n1p, *n2p; { int x, y; x = ABS(((*n1p - 1) % 100) - ((*n2p - 1) % 100)); y = ABS(((*n1p - 1) / 100) - ((*n2p - 1) / 100)); return (MAX(x, y)); }