New level compiler: code changes

This commit is contained in:
Pasi Kallinen
2015-02-18 20:14:40 +02:00
parent 7912a566e5
commit 47bb9abace
14 changed files with 7189 additions and 3776 deletions

View File

@@ -398,6 +398,20 @@ dist2(x0, y0, x1, y1) /* square of euclidean distance between pair of pts */
return dx * dx + dy * dy;
}
int
isqrt(val)
int val;
{
int rt = 0;
int odd = 1;
while(val >= odd) {
val = val-odd;
odd = odd+2;
rt = rt + 1;
}
return rt;
}
boolean
online2(x0, y0, x1, y1) /* are two points lined up (on a straight line)? */
int x0, y0, x1, y1;