xc=!eval $xx_size*($click_x-$border)/$inssize1+$x_size1
yc=!eval $yy_size*(-$click_y+$border)/$inssize2+$y_size2

!if $status=waiting
  !if $opar1<2
   	liste=
   	!for i=1 to $n
     		u=$(abscisse$i)
     		v=$(ordonnee$i)
			liste=!append item $[((($xc) - ($u))^2 + (($yc) - ($v))^2)^(1/2)] to $liste
		!next i
		liste1=!sort numeric item $liste 
		m=!item 1 of $liste1
		m1=!item 2 of $liste1

		!if $[$m1-($m)]<$incert/$xx_size
			error=pas_de_point
		!else
  			pt=!positionof item $m in $liste
!!Le point a dj t slectionn ?
    		u=!item $pt of $ccc
     		ccc=!exec pari Q=[$ccc]; Q[$pt]=1-Q[$pt]; print(Q)
     		ccc=!trim $ccc
!! Prparation du trac des sommets de la cc
     		dessin_aretes=$empty
     		!for i=1 to $n
      			u=!item $i of $ccc
       		!if $u=1
        			ptabs=$(abscisse$i)
         			ptord=$(ordonnee$i)
         			dessin_aretes=$dessin_aretes\
         			disk $ptabs,$ptord, 6, $color5
      			!endif
    		!next i
 	 !endif
	!else
  
  !!analyse de la rponse: toutes les aretes contiennent un sommet de ccc
		ccc=!nospace $ccc
		GM=!translate internal ; to $\
$ in $G
		posc=!positionof item 1 in $ccc

		err_n= !itemcnt $posc
		erreur=$empty
 		!for i=1 to $n
 			l=!line $i of $GM
 			pos=!positionof item 1 in $l
 			!for j in $pos
				!if $j>$i
					tt=!listintersect $i,$j and $posc
					!if $tt=$empty
						erreur=!append line $i,$j to $erreur
					!endif
				!endif
			!next $j
		!next i
!! tester que c'est minimal ?  demander aussi qu'il y ait au plus cnt_a/2 sommets

		!if $erreur=$empty
			!for j=1 to $n
				U=!item $j of $ccc
				!if $U=1
					ccd=!replace item number $j  by 0 in $ccc
					pos=!positionof item 1 in $ccd
					test=1
					cnt=0
					!for i=1 to $n
						!for k=$i+1 to $n
							l=!line $i of $GM
							w=!item $k of $l
							!if $w=1
								a=!listintersect $i,$k and $pos
								!if $a=$empty
									test =0
									!goto test
								!endif
							!endif
						!next k
					!next i
:test
					!if $test=1
						test=$j
						!break
					!endif
				!endif
			!next j 
		!endif

		erreur=!nonempty lines $erreur
		err=!linecnt $erreur
	
		!ifval $err=0 and $test=0
			module_score=10
		!endif
		!if $err<>0
			module_score=$[max(0,10-3*$err)]
		!endif
		!if $err=0 and $test >0
			module_score=5
		!endif
		!if $err_n >$[ceil($cnt_a/2)+1]
			module_score=0
		!endif
    	 status=done
  
    	 !for i =1 to $err  
   			l=!line $i of $erreur
    		!distribute item $l into j,k
			dessin_aretes=$dessin_aretes\
line $(abscisse$j),$(ordonnee$j),$(abscisse$k),$(ordonnee$k),$color3
		!next i
		!if $err=0 and $test>0
			dessin_aretes=$dessin_aretes\
disk $(abscisse$test),$(ordonnee$test), 10,$color4
 		!endif
  	!endif
!endif

click_x=0
click_y=0
yc=0
xc=0
