1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
struct player
{
string name;
float live;
};
int main()
{
player joueur1;
joueur1.name = "Player1";
joueur1.live = 59.8;
cout << "Nom du joueur1 : " << joueur1.name << endl;
cout << "Vie du joueur1 : " << joueur1.live << "%" << endl;
cout << "________________________________________\n" << endl;
player joueur2;
joueur2.name = "Player2";
joueur2.live = 12.0;
cout << "Nom du joueur2 : " << joueur2.name << endl;
cout << "Vie du joueur2 : " << joueur2.live << "%" << endl;
cout << "________________________________________\n" << endl;
string commande;
int boucle_commande = 0;
do
{
cout << "[Commande]$" ;
cin >> commande;
if (commande == "exit")
{
boucle_commande = 1;
}
if(commande == "cheat")
{
string commande2;
cout << "Il ne faut pas faire des cheats !" << endl;
cout << "[Commande/Player]$";
cin >> commande2;
//partie su programme non fini
}
}while(boucle_commande == 0);
system("pause");
return 0;
} |