MCPcopy Index your code
hub / github.com/NetHack/NetHack / dist2

Function dist2

src/hacklib.c:672–678  ·  view source on GitHub ↗

square of Euclidean distance between pair of pts */

Source from the content-addressed store, hash-verified

670
671/* square of Euclidean distance between pair of pts */
672int
673dist2(coordxy x0, coordxy y0, coordxy x1, coordxy y1)
674{
675 coordxy dx = x0 - x1, dy = y0 - y1;
676
677 return dx * dx + dy * dy;
678}
679
680/* integer square root function without using floating point */
681int

Callers 15

fill_zooFunction · 0.85
mons_see_trapFunction · 0.85
flash_hits_monFunction · 0.85
show_transient_lightFunction · 0.85
drag_ballFunction · 0.85
revive_monFunction · 0.85
select_rwepFunction · 0.85
findtravelpathFunction · 0.85
trapmoveFunction · 0.85
lookaroundFunction · 0.85
md_stopFunction · 0.85
md_rushFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected