Created
August 31, 2020 18:04
-
-
Save suzukiyoshihisa/700a96f882a2e104b264a7c0e12af948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def main(): | |
dice_rolls = int(input('何個サイコロを振りますか? ')) | |
dice_size = int(input('サイコロの最大値は何にしますか? ')) | |
dice_sum = 0 | |
for i in range(0, dice_rolls): | |
roll = random.randint(1, dice_size) | |
dice_sum += roll | |
if roll == 1: | |
print(f'You rolled a {roll}! Critical Fail') | |
elif roll == dice_size: | |
print(f'You rolled a {roll}! Critical Success!') | |
else: | |
print(f'You rolled a {roll}') | |
print(f'サイコロの合計値は {dice_sum} です') | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment