public static void main(String args[]){ 
      
      initDisplay(); 
      drawDisplay(); 
      canvas.setPaint(Color.BLACK);
      canvas.drawString("You go first: drag your mouse between two vertices to move.", 100, 550);

      
      // comment-in the second line and comment-out the first to use your Player class
      
      //RandomPlayer P = new RandomPlayer(); 
      Player P = new Player(); 
      
      JEventQueue events=new JEventQueue(); 
      events.listenTo(canvas,"canvas"); 
      
      int x0 = 0;
      int y0 = 0; 
      
      int round = 0; 
      while(!completeGraph(G)) {

         
         EventObject event=events.waitEvent(); 
         if(events.isMouseEvent(event)){ 
            int x=events.getMouseX(event); 
            int y=events.getMouseY(event); 
            if(events.isMousePressed(event)){
               x0=x;
               y0=y;
            } 
            

            if(events.isMouseReleased(event)) {
               // draw a red edge between vertices closest to
               //    begin and end of mouse drag
               
               int source = closestVertex(x0,y0);  
               int target = closestVertex(x,y);   

               if(source != target && !G.isEdge(source,target)) {
                  G.addEdge(source, target,1);


               }
               else if(source == target) {
                  canvas.setPaint(Color.BLACK);
                  canvas.drawString("You may not draw an edge from a vertex to itself... try again!", 100, 530);
                  continue; 
               }
               else {
                  canvas.setPaint(Color.BLACK);
                  canvas.drawString("You may not redraw a blue edge... try again!", 100, 550);
                  continue; 
               }

             drawDisplay(); 
               
               if(G.isCycleOfLength(3,1)) {
                  canvas.setPaint(Color.BLACK);
                  canvas.drawString("Blue Player Wins!", 100, 550);
                  break;
               }
               
               canvas.sleep(1000);

               // get move (edge) from player and make a move as blue
               
               Move m = P.chooseMove(G);
               System.out.println(m); 
               G.addEdge(m.source, m.target, -1); 

               drawDisplay(); 

               if(G.isCycleOfLength(3,-1)) {
                  canvas.setPaint(Color.BLACK);
                  canvas.drawString("Red Player Wins!", 100, 550);
                  break;
               }
  
               
            }
    
         } 
      } 
   }