Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- #include<ctime>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "Swedish");
- srand((unsigned)time(0));
- int nrOFRolls=0;
- int result=0;
- int summa=0; //sum
- int ingen=0;
- char player;
- cout<<"Nu spelar vi"" ""Tur i tärning!"<<endl; //lets play a game
- cout<<"Hur många tärningskast ska göras per spelare?"; // how many rolls should each player have?
- cin>>nrOFRolls;
- for(int i=0; i<=nrOFRolls; i++)
- {
- @h@cout<<"Namnet på spelaren?"; //name of the player
- cin>>player;
- result=(rand()%6+1);@h@ //here is the part where i got stuck bcs when i runt this it just me couple of rolls and enter name of the player and then it closes...
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement