Roll the dice and reach a position then sum the position [closed]











up vote
-2
down vote

favorite













In a turn-based manner, allow the player to roll a dice (1-6) to
travel to the next location. For simplicity, we assume each number
represents travelling across 1 location and that there are 10
locations in the game, with the last location (location 10) belonging
to the lair of the boss.



Supposed to show:





You rolled 1
You have reached position 1
Press Enter to roll your dice:
You rolled 4
You have reached position 5
Fallen into enemy's trap! Half of HP lost!!
New HP: 50.0
Press Enter to roll your dice:



My code:





while dice == "":
if dice == "":
import random
num=random.randint(1,6)
print("You rolled",num)
print("You have reached position",num)
dice=input("Press enter to roll your dice:")

while position >= 10:
print("-"*10)
print("You have found the boss in its lair!")
print("NasBoss with HP 1000 encountered!")
print("Fighting starts!")
print("-"*10)









share|improve this question















closed as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher Nov 18 at 12:19


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    Please fix indentation.
    – hjpotter92
    Nov 18 at 4:57















up vote
-2
down vote

favorite













In a turn-based manner, allow the player to roll a dice (1-6) to
travel to the next location. For simplicity, we assume each number
represents travelling across 1 location and that there are 10
locations in the game, with the last location (location 10) belonging
to the lair of the boss.



Supposed to show:





You rolled 1
You have reached position 1
Press Enter to roll your dice:
You rolled 4
You have reached position 5
Fallen into enemy's trap! Half of HP lost!!
New HP: 50.0
Press Enter to roll your dice:



My code:





while dice == "":
if dice == "":
import random
num=random.randint(1,6)
print("You rolled",num)
print("You have reached position",num)
dice=input("Press enter to roll your dice:")

while position >= 10:
print("-"*10)
print("You have found the boss in its lair!")
print("NasBoss with HP 1000 encountered!")
print("Fighting starts!")
print("-"*10)









share|improve this question















closed as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher Nov 18 at 12:19


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 2




    Please fix indentation.
    – hjpotter92
    Nov 18 at 4:57













up vote
-2
down vote

favorite









up vote
-2
down vote

favorite












In a turn-based manner, allow the player to roll a dice (1-6) to
travel to the next location. For simplicity, we assume each number
represents travelling across 1 location and that there are 10
locations in the game, with the last location (location 10) belonging
to the lair of the boss.



Supposed to show:





You rolled 1
You have reached position 1
Press Enter to roll your dice:
You rolled 4
You have reached position 5
Fallen into enemy's trap! Half of HP lost!!
New HP: 50.0
Press Enter to roll your dice:



My code:





while dice == "":
if dice == "":
import random
num=random.randint(1,6)
print("You rolled",num)
print("You have reached position",num)
dice=input("Press enter to roll your dice:")

while position >= 10:
print("-"*10)
print("You have found the boss in its lair!")
print("NasBoss with HP 1000 encountered!")
print("Fighting starts!")
print("-"*10)









share|improve this question
















In a turn-based manner, allow the player to roll a dice (1-6) to
travel to the next location. For simplicity, we assume each number
represents travelling across 1 location and that there are 10
locations in the game, with the last location (location 10) belonging
to the lair of the boss.



Supposed to show:





You rolled 1
You have reached position 1
Press Enter to roll your dice:
You rolled 4
You have reached position 5
Fallen into enemy's trap! Half of HP lost!!
New HP: 50.0
Press Enter to roll your dice:



My code:





while dice == "":
if dice == "":
import random
num=random.randint(1,6)
print("You rolled",num)
print("You have reached position",num)
dice=input("Press enter to roll your dice:")

while position >= 10:
print("-"*10)
print("You have found the boss in its lair!")
print("NasBoss with HP 1000 encountered!")
print("Fighting starts!")
print("-"*10)






python dice






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 18 at 5:10

























asked Nov 18 at 3:56









user184984

11




11




closed as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher Nov 18 at 12:19


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher

If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher Nov 18 at 12:19


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – 200_success, Sᴀᴍ Onᴇᴌᴀ, t3chb0t, πάντα ῥεῖ, Graipher

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 2




    Please fix indentation.
    – hjpotter92
    Nov 18 at 4:57














  • 2




    Please fix indentation.
    – hjpotter92
    Nov 18 at 4:57








2




2




Please fix indentation.
– hjpotter92
Nov 18 at 4:57




Please fix indentation.
– hjpotter92
Nov 18 at 4:57















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Сан-Квентин

Алькесар

Josef Freinademetz