Skip to content

Instantly share code, notes, and snippets.

@anirul
Created September 18, 2020 13:37
Show Gist options
  • Save anirul/3d64751281b04ca2cc4e1d0a354c0c25 to your computer and use it in GitHub Desktop.
Save anirul/3d64751281b04ca2cc4e1d0a354c0c25 to your computer and use it in GitHub Desktop.
#include <iostream>
int main ()
{
std::cout << " Roll your dice between 1 and 8 to beat Boss\n";
int pvFinaux = 100;
int value = 0 ;
std::cin >> value;
int attaque = 6;
int defense = 30;
int attaqueFinale = attaque * value;
bool exit = false;
while ( !exit )
{
if (attaqueFinale > defense)
{
std::cout << "B perd des pv\n";
pvFinaux = pvFinaux- (attaqueFinale - defense );
}
else
{
std::cout << "Esquive\n";
}
std::cout << pvFinaux << std::endl;
if (pvFinaux <= 0)
{
break;
}
system("pause");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment