#include <iostream>
#include <cstdlib>
#include <time.h>
#include <windows.h>
#include <cstdio>
using namespace std;
int wybor;
int punktyh=0,punktyai=0;
int wyborai;
int main()
{
srand(time(NULL));
while (punktyh!=3 && punktyai!=3)
{
cout << endl<<"papier kamien no-zy-ce: " << endl<< endl;
cout << "1.papier " << endl;
cout << "2.kamien " << endl;
cout << "3.nozyce" << endl;
cin>>wybor;
wyborai=rand()%3+1;
system("cls");
if(wyborai==1) cout<<"Wybor AI: papier"<<endl;
if(wyborai==2) cout<<"Wybor AI: kamien"<<endl;
if(wyborai==3) cout<<"Wybor AI: nozyce"<<endl;
if((wybor==1)&&(wyborai==1))
{
cout<<"remis"<<endl;
}
else if ((wybor==1)&&(wyborai==2))
{
punktyh++;
cout<<"punkt dla ciebie"<<endl;
}
//
else if ((wybor==1)&&(wyborai==3))
{
cout<<"punkt dla AI"<<endl;
punktyai++;
}
else if ((wybor==2)&&(wyborai==1))
{
cout<<"punkt dla AI";
punktyai++;
}
else if ((wybor==2)&&(wyborai==2))
{
cout<<"remis"<<endl;
}
else if ((wybor==2)&&(wyborai==3))
{
cout<<"punkt dla ciebie"<<endl;
punktyh++;
}
else if ((wybor==3)&&(wyborai==1))
{
cout<<"punkt dla ciebie"<<endl;
punktyh++;
}
else if ((wybor==3)&&(wyborai==2))
{
cout<<"punkt dla AI";
punktyai++;
}
else if ((wybor==3)&&(wyborai==3))
{
cout<<"remis"<<endl;
}
cout<<endl<<"punkty AI: "<<punktyai<<endl;
cout<<endl<<"Twoje punkty: "<<punktyai<<endl;
}
if(punktyai<=punktyh)
{
cout<<endl<<"WYGRALES"<<endl;
getchar();
getchar();
}
else
{
cout<<endl<<"PRZEGRALES"<<endl;
getchar();
getchar();
}
return 0;
}
Gdy Ai wybiera nożyce a ja papier to obaj dostajemy punkty a gdy wybiore inną opcję to niezależnie od wyboru komp-
utera nikt nie dostaje punktów :( .