//-----------------------------------------------
//Main routine begins here
//-----------------------------------------------

GeoPoint p, q;
GeoUGraph g;                // you have to define a graph anyway
int i = 0;
int L = (*inp).length();        // (*inp) is the input, point list
GeoLineSeg s[L];

inp->graphicDelete();        // delete the point entered
forall (p, (*inp)) {                // forall: assign a point in order in each iteration
        GeoNode y((i+1)*20, p.getY());
        y.setWeight(y.getY());        // weight means label
        g.newNode(y);                // new a node the same as y in g
        if (i > 0) {
                s[i].setLineSeg(y.getX(), y.getY(), q.getX(), q.getY());
        }

        q.setPoint(y.getX(), y.getY());
        i++;
}
g.graphicConstruct();                // draw g
GeoPause("Please press \"PauseReturn\" to continue.");        // suspend the process until "PauseReturn" being pressed
for (i = 1; i < (*inp).length(); i++) {
        s[i].graphicConstruct();
}

//-----------------------------------------------
//End of main rountine
//-----------------------------------------------

