#include #include using namespace std; using namespace sio; int main() { string tab[3] = {"pierre","feuille","ciseaux"}; string J1 = "",J2 = ""; int armeJ1 = 0, armeJ2 = 0, pointJ1 = 0, pointJ2 = 0; bool fin; cout << "Nom du premier joueur : "; cin >> J1; cout << "Nom du deuxieme joueur : "; cin >> J2; //1 = pierre; 2 = feuille; 3 = ciseaux getchar(); do { armeJ1 = aleatoire(1,3); armeJ2 = aleatoire(1,3); if(armeJ1 == 1 && armeJ2 == 3) { pointJ1++; cout << J1 << " : " << tab[armeJ1-1] << " - " << J2 << " : " << tab[armeJ2-1] << " ===> " << J1 << " + 1 point"; } else if (armeJ1 == 1 && armeJ2 == 2) { pointJ2++; cout << J1 << " : " << tab[armeJ1-1] << " - " << J2 << " : " << tab[armeJ2-1] << " ===> " << J2 << " + 1 point"; } else if(armeJ1 == 2 && armeJ2 == 1) { pointJ1++; cout << J1 << " : " << tab[armeJ1-1] << " - " << J2 << " : " << tab[armeJ2-1] << " ===> " << J1 << " + 1 point"; } else if (armeJ1 == 2 && armeJ2 == 3) { pointJ2++; cout << J1 << " : " << tab[armeJ1-1] << " - " << J2 << " : " << tab[armeJ2-1] << " ===> " << J2 << " + 1 point"; } else if (armeJ1 == 3 && armeJ2 == 1) { pointJ2++; cout << J1 << " : " << tab[armeJ1-1] << " - " << J2 << " : " << tab[armeJ2-1] << " ===> " << J2 << " + 1 point"; } else if (armeJ1 == 3 && armeJ2 == 2) { pointJ1++; cout << J1 << " : " << tab[armeJ1-1] << " - " << J2 << " : " << tab[armeJ2-1] << " ===> " << J1 << " + 1 point"; } else { cout << J1 << " : " << tab[armeJ1-1] << " - " << J2 << " : " << tab[armeJ2-1] << " ===> Egalite - pas de point"; } fin = saisie_oui_non("\nUne autre partie ?"); }while(fin != false); if (pointJ1 > pointJ2) { cout << J1 << " gagne avec " << pointJ1 << " points (" << J2 << " : " << pointJ2 << " points)\n"; } else if(pointJ1 < pointJ2) { cout << J2 << " gagne avec " << pointJ2 << " points (" << J1 << " : " << pointJ1 << " points)\n"; } else { cout << "Egalite avec " << pointJ1 << " points !\n"; } return 0; }