Total circles area: Difference between revisions
Content added Content deleted
(add FreeBASIC) |
(→Scanline version: Now uses new core library method.) |
||
Line 3,493: | Line 3,493: | ||
Quicker (about 4.7 seconds) and more precise (limited to 5 d.p. but achieves 7) than the above version. |
Quicker (about 4.7 seconds) and more precise (limited to 5 d.p. but achieves 7) than the above version. |
||
<lang ecmascript>import "/dynamic" for Tuple |
<lang ecmascript>import "/dynamic" for Tuple |
||
import "/math" for Nums |
import "/math" for Nums |
||
import "/sort" for Sort |
import "/sort" for Sort |
||
Line 3,547: | Line 3,547: | ||
for (p in points) { |
for (p in points) { |
||
if (p.y > right) { |
if (p.y > right) { |
||
total = total + p.y - |
total = total + p.y - p.x.max(right) |
||
right = p.y |
right = p.y |
||
} |
} |