I was wondering how i could set up a random number loop, but have it stop looping when it hits 1 or any other number i assign.
i use dev C++ compiler
//Damage Roller
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <conio.h>
using namespace std;
int main()
{
srand(time(0));
do{
int randomNumber = rand();
int die = (randomNumber%6)+1;
cout<<"You hit for "<<die<<" damage"<<endl;
getch();
}while(1);
return 0;
}