#include #include #include "descartes.h" int main(void) { point_t curr, /* Current point */ prev, /* Previous point */ init; /* Initial point */ lineSeg_t l; /* Line segment joining prev and curr */ OpenGraphics(); prev = GetPoint(); curr = GetPoint(); init = prev; /* this stores the first vertex in the variable "init": we need to remember it, to be able to join it to the last vertex when it is entered */ while (XCoord(curr) >= 0) { /* * Process the current edge. * The current edge joins the previous * vertex "prev" to the current vertex "curr". */ prev = curr; curr = GetPoint(); } /* * Now tackle the last edge - remember, the first vertex * is stored in the variable "init" */ CloseGraphics(); return EXIT_SUCCESS; }