Application console
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
e624363abf
commit
2e1dcef32b
@ -1,7 +1,60 @@
|
||||
using CoreLibrary;
|
||||
using ConsoleApp;
|
||||
|
||||
|
||||
JetonIndicateur ji1 = new JetonIndicateur(Couleur.Noir);
|
||||
Console.WriteLine(ji1.Couleur);
|
||||
Jeton j1 = new JetonIndicateur(Couleur.Blanc);
|
||||
Console.WriteLine(j1.Couleur);
|
||||
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
|
||||
ReglesClassiques partie = new ReglesClassiques();
|
||||
|
||||
Utils.AfficherTitre();
|
||||
|
||||
Utils.AfficherTitre("Joueurs");
|
||||
string joueur1 = Utils.SaisirNom();
|
||||
string joueur2 = Utils.SaisirNom();
|
||||
Utils.AfficherSeparateur();
|
||||
|
||||
partie.AjouterJoueur(joueur1);
|
||||
partie.AjouterJoueur(joueur2);
|
||||
|
||||
partie.CommencerLaPartie();
|
||||
|
||||
while (!partie.EstTerminee())
|
||||
{
|
||||
Console.WriteLine(partie.JoueurCourant().Nom);
|
||||
Console.WriteLine();
|
||||
|
||||
Utils.DessinerPlateau(partie.JoueurCourant().Plateau.Grille(), partie.JoueurCourant().Plateau.Indicateurs());
|
||||
Console.WriteLine();
|
||||
|
||||
Code code = partie.GenererCode();
|
||||
|
||||
Utils.ChoixCode(ref code);
|
||||
|
||||
partie.JoueurCourant().Plateau.AjouterCode(code);
|
||||
|
||||
partie.PasserLaMain();
|
||||
|
||||
Utils.AfficherSeparateur();
|
||||
}
|
||||
|
||||
Console.WriteLine("La partie est maintenant terminée !");
|
||||
|
||||
Joueur[] gagnants = partie.Gagnants().ToArray();
|
||||
Joueur[] perdants = partie.Perdants().ToArray();
|
||||
|
||||
|
||||
|
||||
if (gagnants.Length > 1)
|
||||
{
|
||||
Console.WriteLine("C'est une égalité !");
|
||||
}
|
||||
else if (gagnants.Length == 1)
|
||||
{
|
||||
Console.WriteLine($"C'est une victoire de {gagnants[0].Nom}." +
|
||||
$"");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("C'est une défaite...");
|
||||
}
|
||||
|
Loading…
Reference in new issue