For some reason that doesnt work for getting a number between 1 and 7 i dunt no how to get a number between that could someone point out howCode:srand(time(NULL)); if(input == "gameover") { random =(rand() % (6 - 1 + 1)) + 1; if( random == 1) { cout <<"You Stumble along the dirt road and find a penny\n"; money = money + 1; if(counter >= 1) { counter = counter - 1; } } if( random == 2) { cout <<"You reach into yer moms pocket and pull out a penny\n"; money = money + 1; if(counter >= 1) { counter = counter - 1; } } if(random == 3) { cout <<"As you search your couch you find a penny\n"; money = money + 1; if(counter >= 1) { counter = counter - 1; } } if(random == 4 && counter == 0) { cout <<"As you wander helplessly down the street you get knocked in the head.\n" <<"You wake up later to find yourself in a alley and yer pockets empty\n"; money = 0; counter = 5; } if(random == 5) { cout <<"You ask the mayor for bebe mooneys he gives u a penny\n"; money = money + 1; if(counter >= 1) { counter = counter - 1; } } if(random == 6) { cout <<"You Beg for mooneys and recieve a penny for a hard days work\n"; money = money + 1; if(counter >= 1) { counter = counter - 1; } }
Maby it does maby its something else but sometimes when it types it doesnt respond no output so im thinking thiers a hole somewere