Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- import sys
- NUMBER_OF_OPEN_SPACES = 2
- OPEN_SPACE_1 = ['gauche']
- OPEN_SPACE_2 = ['droite']
- def main():
- number_of_players = int(input("Combien de personnes participent? "))
- people_per_room = number_of_players // NUMBER_OF_OPEN_SPACES
- people_left_to_affect = number_of_players % NUMBER_OF_OPEN_SPACES
- affectations = (OPEN_SPACE_1 * people_per_room) \
- + (OPEN_SPACE_2 * people_per_room) \
- + (OPEN_SPACE_2 * people_left_to_affect)
- random.shuffle(affectations)
- for affectation in affectations:
- input("Presse une touche de clavier pour lancer la roue ")
- print_loading_animation()
- print("\nYou've been affected to: \n {}".format(ASCII_RESULTS.get(affectation)))
- print('-'*20)
- def print_loading_animation():
- for i in range(ANIMATION_LENGHT):
- time.sleep(0.1)
- sys.stdout.write("\r" + ANIMATION[i % len(ANIMATION)])
- sys.stdout.flush()
- ANIMATION_LENGHT = random.randrange(20,80)
- ANIMATION = "|/-\\"
- ASCII_RESULTS = {
- 'gauche':
- '''
- __ _____ _
- / / | __ \ | |
- / / | | \/ __ _ _ _ ___| |__ ___
- < < | | __ / _` | | | |/ __| '_ \ / _ \
- \ \ | |_\ \ (_| | |_| | (__| | | | __/
- \_\ \____/\__,_|\__,_|\___|_| |_|\___|
- ''',
- 'droite':
- '''
- ______ _ _ __
- | _ \ (_) | \ \
- | | | |_ __ ___ _| |_ ___ \ \
- | | | | '__/ _ \| | __/ _ \ > >
- | |/ /| | | (_) | | || __/ / /
- |___/ |_| \___/|_|\__\___| /_/
- '''}
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement