class Jeu{
    Pion jauneLent;
    Pion jauneRapide;
    
    Pion rougeLent;
    Pion rougeRapide;
    
    Jeu(){
	jauneLent=new Pion("jaune",false);
	jauneRapide=new Pion("jaune",true);
	rougeLent=new Pion("rouge",false);
	rougeRapide=new Pion("rouge",true);
    }
    
    void jouer(String couleur){
	double rand=Math.random();
	int nbcases;
	if (rand>0.5){
	    nbcases=(int)(12*Math.random()+1);
	    if(couleur.equals("jaune")){
		jauneRapide.avancer(nbcases);}
	    else{rougeRapide.avancer(nbcases);}
	}
	else{
	    nbcases=(int)(6*Math.random()+1);
	    if(couleur.equals("jaune")){
		jauneLent.avancer(nbcases);}
	    else{rougeLent.avancer(nbcases);}
	}
    }
    
     boolean aGagne(String couleur){
	if(couleur.equals("jaune")){
	    if (jauneLent.estArrive()&&jauneRapide.estArrive()){
		return true;
	    }
	    else {return false;}
	}
	else{
	    if (rougeLent.estArrive()&&rougeRapide.estArrive()){
		return true;
	    }
	    else {return false;}
	}

    }
    
     void conflit(Pion p){
	if(p.couleur.equals("jaune")){
	    if(p.position==rougeLent.position){
		rougeLent.position=10;
	    }
	    if(p.position==rougeRapide.position){
		rougeRapide.position=10;
	    }
	}
	else{
	    if(p.position==jauneLent.position){
		jauneLent.position=0;
	    }
	    if(p.position==jauneRapide.position){
		jauneRapide.position=0;
	    }
	}
    }

     void jouer2(String couleur){
	double rand=Math.random();
	int nbcases;
	if (rand>0.5){
	    nbcases=(int)(12*Math.random()+1);
	    if(couleur.equals("jaune")){
		jauneRapide.avancer(nbcases);}
	    else{rougeRapide.avancer(nbcases);}
	}
	else{
	    nbcases=(int)(6*Math.random()+1);
	    if(couleur.equals("jaune")){
		jauneLent.avancer(nbcases);}
	    else{rougeLent.avancer(nbcases);}
	}
    }
    
    void partie(){
	int compteur=0;
	boolean termine=false;
	while(termine==false){
	    if (compteur%2==0){
		this.jouer("jaune");
		termine=this.aGagne("jaune");}
	    else{
		this.jouer("rouge");
		termine=this.aGagne("rouge");
	    }
	}
	if(this.aGagne("jaune")){ System.
    }

    public static void main(String[] args){
	Jeu a=new Jeu();
	
    }
}

