How to sum the scores from each round in my dice game?
I created this dice game. How can I sum the score from each round after the user says they do not want to roll again? Thank you!!!
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
python
add a comment |
I created this dice game. How can I sum the score from each round after the user says they do not want to roll again? Thank you!!!
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
python
1
Create a variable that is used for counting, and increment it each time the user rolls. Finally print it.
– Dschoni
Nov 19 '18 at 16:48
add a comment |
I created this dice game. How can I sum the score from each round after the user says they do not want to roll again? Thank you!!!
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
python
I created this dice game. How can I sum the score from each round after the user says they do not want to roll again? Thank you!!!
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
python
python
asked Nov 19 '18 at 16:46


Anna Hamelin
197
197
1
Create a variable that is used for counting, and increment it each time the user rolls. Finally print it.
– Dschoni
Nov 19 '18 at 16:48
add a comment |
1
Create a variable that is used for counting, and increment it each time the user rolls. Finally print it.
– Dschoni
Nov 19 '18 at 16:48
1
1
Create a variable that is used for counting, and increment it each time the user rolls. Finally print it.
– Dschoni
Nov 19 '18 at 16:48
Create a variable that is used for counting, and increment it each time the user rolls. Finally print it.
– Dschoni
Nov 19 '18 at 16:48
add a comment |
2 Answers
2
active
oldest
votes
Just add the score up to sum. And print the sum after they decide not to roll any more.
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
sum = 0
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
sum = sum + score
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
print(sum)
Thank you so much! This was so helpful and it ran perfectly!!!
– Anna Hamelin
Nov 19 '18 at 17:01
1
I'm glad that it helps. Could you give me a upvote? Or accept it as answer?
– MIKEC
Nov 19 '18 at 17:50
of course thank you again!
– Anna Hamelin
Nov 19 '18 at 17:52
add a comment |
Just store the sum in a variable, and print it later, like this:
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
# Create variable to store the accumulated score
total_score = 0
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
total_score = total_score + score
print("Here is your score:",total_score)
else:
print("Ok!")
1
Your printing of the total score is in the wrong place. It should be inside theif
, but outside thewhile
loop. If you have it in theelse
, you will only display it if they do not play the game at all.
– Patrick Haugh
Nov 19 '18 at 16:53
This works perfectly except it isn't printing the final score for some reason. Can you help me fix that? Thank you so much for the help I really appreciate it
– Anna Hamelin
Nov 19 '18 at 16:55
Wow ! Sorry, ill fix it know. Patrick Haugh is right!
– Manrique
Nov 19 '18 at 16:59
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379184%2fhow-to-sum-the-scores-from-each-round-in-my-dice-game%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Just add the score up to sum. And print the sum after they decide not to roll any more.
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
sum = 0
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
sum = sum + score
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
print(sum)
Thank you so much! This was so helpful and it ran perfectly!!!
– Anna Hamelin
Nov 19 '18 at 17:01
1
I'm glad that it helps. Could you give me a upvote? Or accept it as answer?
– MIKEC
Nov 19 '18 at 17:50
of course thank you again!
– Anna Hamelin
Nov 19 '18 at 17:52
add a comment |
Just add the score up to sum. And print the sum after they decide not to roll any more.
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
sum = 0
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
sum = sum + score
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
print(sum)
Thank you so much! This was so helpful and it ran perfectly!!!
– Anna Hamelin
Nov 19 '18 at 17:01
1
I'm glad that it helps. Could you give me a upvote? Or accept it as answer?
– MIKEC
Nov 19 '18 at 17:50
of course thank you again!
– Anna Hamelin
Nov 19 '18 at 17:52
add a comment |
Just add the score up to sum. And print the sum after they decide not to roll any more.
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
sum = 0
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
sum = sum + score
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
print(sum)
Just add the score up to sum. And print the sum after they decide not to roll any more.
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
sum = 0
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
sum = sum + score
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
print(sum)
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
sum = 0
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
sum = sum + score
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
print(sum)
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
sum = 0
game_response = input("Would you like to roll your dice (y/n)? ")
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
sum = sum + score
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
else:
print("Ok!")
print(sum)
answered Nov 19 '18 at 16:55
MIKEC
262
262
Thank you so much! This was so helpful and it ran perfectly!!!
– Anna Hamelin
Nov 19 '18 at 17:01
1
I'm glad that it helps. Could you give me a upvote? Or accept it as answer?
– MIKEC
Nov 19 '18 at 17:50
of course thank you again!
– Anna Hamelin
Nov 19 '18 at 17:52
add a comment |
Thank you so much! This was so helpful and it ran perfectly!!!
– Anna Hamelin
Nov 19 '18 at 17:01
1
I'm glad that it helps. Could you give me a upvote? Or accept it as answer?
– MIKEC
Nov 19 '18 at 17:50
of course thank you again!
– Anna Hamelin
Nov 19 '18 at 17:52
Thank you so much! This was so helpful and it ran perfectly!!!
– Anna Hamelin
Nov 19 '18 at 17:01
Thank you so much! This was so helpful and it ran perfectly!!!
– Anna Hamelin
Nov 19 '18 at 17:01
1
1
I'm glad that it helps. Could you give me a upvote? Or accept it as answer?
– MIKEC
Nov 19 '18 at 17:50
I'm glad that it helps. Could you give me a upvote? Or accept it as answer?
– MIKEC
Nov 19 '18 at 17:50
of course thank you again!
– Anna Hamelin
Nov 19 '18 at 17:52
of course thank you again!
– Anna Hamelin
Nov 19 '18 at 17:52
add a comment |
Just store the sum in a variable, and print it later, like this:
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
# Create variable to store the accumulated score
total_score = 0
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
total_score = total_score + score
print("Here is your score:",total_score)
else:
print("Ok!")
1
Your printing of the total score is in the wrong place. It should be inside theif
, but outside thewhile
loop. If you have it in theelse
, you will only display it if they do not play the game at all.
– Patrick Haugh
Nov 19 '18 at 16:53
This works perfectly except it isn't printing the final score for some reason. Can you help me fix that? Thank you so much for the help I really appreciate it
– Anna Hamelin
Nov 19 '18 at 16:55
Wow ! Sorry, ill fix it know. Patrick Haugh is right!
– Manrique
Nov 19 '18 at 16:59
add a comment |
Just store the sum in a variable, and print it later, like this:
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
# Create variable to store the accumulated score
total_score = 0
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
total_score = total_score + score
print("Here is your score:",total_score)
else:
print("Ok!")
1
Your printing of the total score is in the wrong place. It should be inside theif
, but outside thewhile
loop. If you have it in theelse
, you will only display it if they do not play the game at all.
– Patrick Haugh
Nov 19 '18 at 16:53
This works perfectly except it isn't printing the final score for some reason. Can you help me fix that? Thank you so much for the help I really appreciate it
– Anna Hamelin
Nov 19 '18 at 16:55
Wow ! Sorry, ill fix it know. Patrick Haugh is right!
– Manrique
Nov 19 '18 at 16:59
add a comment |
Just store the sum in a variable, and print it later, like this:
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
# Create variable to store the accumulated score
total_score = 0
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
total_score = total_score + score
print("Here is your score:",total_score)
else:
print("Ok!")
Just store the sum in a variable, and print it later, like this:
import colorama
colorama.init()
print_in_green = "x1b[32m"
print_in_red = "x1b[31m"
print_in_blue = "x1b[36m"
print_in_pink = "x1b[35m"
print_default = "x1b[0m"
import random
min = 1
max = 6
game_response = input("Would you like to roll your dice (y/n)? ")
# Create variable to store the accumulated score
total_score = 0
if game_response == "y":
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are:")
dice1 = random.randint(min, max)
dice2 = random.randint(min, max)
print(print_in_pink)
print(int(dice1))
print(int(dice2))
print(print_default)
score = (int(dice1) + int(dice2))
roll_again = input("Your score for this round is " + str(score) + ". Roll the dices again (y/n)? ")
total_score = total_score + score
print("Here is your score:",total_score)
else:
print("Ok!")
edited Nov 19 '18 at 17:01
answered Nov 19 '18 at 16:51


Manrique
498112
498112
1
Your printing of the total score is in the wrong place. It should be inside theif
, but outside thewhile
loop. If you have it in theelse
, you will only display it if they do not play the game at all.
– Patrick Haugh
Nov 19 '18 at 16:53
This works perfectly except it isn't printing the final score for some reason. Can you help me fix that? Thank you so much for the help I really appreciate it
– Anna Hamelin
Nov 19 '18 at 16:55
Wow ! Sorry, ill fix it know. Patrick Haugh is right!
– Manrique
Nov 19 '18 at 16:59
add a comment |
1
Your printing of the total score is in the wrong place. It should be inside theif
, but outside thewhile
loop. If you have it in theelse
, you will only display it if they do not play the game at all.
– Patrick Haugh
Nov 19 '18 at 16:53
This works perfectly except it isn't printing the final score for some reason. Can you help me fix that? Thank you so much for the help I really appreciate it
– Anna Hamelin
Nov 19 '18 at 16:55
Wow ! Sorry, ill fix it know. Patrick Haugh is right!
– Manrique
Nov 19 '18 at 16:59
1
1
Your printing of the total score is in the wrong place. It should be inside the
if
, but outside the while
loop. If you have it in the else
, you will only display it if they do not play the game at all.– Patrick Haugh
Nov 19 '18 at 16:53
Your printing of the total score is in the wrong place. It should be inside the
if
, but outside the while
loop. If you have it in the else
, you will only display it if they do not play the game at all.– Patrick Haugh
Nov 19 '18 at 16:53
This works perfectly except it isn't printing the final score for some reason. Can you help me fix that? Thank you so much for the help I really appreciate it
– Anna Hamelin
Nov 19 '18 at 16:55
This works perfectly except it isn't printing the final score for some reason. Can you help me fix that? Thank you so much for the help I really appreciate it
– Anna Hamelin
Nov 19 '18 at 16:55
Wow ! Sorry, ill fix it know. Patrick Haugh is right!
– Manrique
Nov 19 '18 at 16:59
Wow ! Sorry, ill fix it know. Patrick Haugh is right!
– Manrique
Nov 19 '18 at 16:59
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379184%2fhow-to-sum-the-scores-from-each-round-in-my-dice-game%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Create a variable that is used for counting, and increment it each time the user rolls. Finally print it.
– Dschoni
Nov 19 '18 at 16:48