Paste Search Dynamic
Recent pastes
players
  1. def get_nb_players():
  2.     nb_players = int(input("Nombres de joueurs : "))
  3.     print("nombre de joueurs : " + str(nb_players))
  4.     return nb_players
  5.  
  6. def setup(nb_players):
  7.     player_list = [""]*nb_players
  8.     for player_nb in range(nb_players):
  9.         player_list[player_nb] = input("Nom du joueur " + str(player_nb + 1) + " : ")
  10.     return player_list
  11.  
  12. def kineto(nb_players, player_list):
  13.     player_points = [0]*nb_players
  14.     while(len(player_list) > 1):
  15.         print("Nouveau tour")
  16.         dead = []
  17.         nb_player = len(player_list)
  18.         for player_nb in range(nb_player):
  19.             player_points[player_nb] += int(input("Nombre de points de " + player_list[player_nb] + " : "))
  20.             if player_points[player_nb] >= 100:
  21.                 print(player_list[player_nb] + " est mort")
  22.                 dead.append(player_nb)
  23.             else :
  24.                 print(player_list[player_nb] + " : " + str(player_points[player_nb]))
  25.         for dead_player in dead:
  26.             player_list.pop(dead_player)
  27.             player_points.pop(dead_player)
  28.     print("Partie terminée")
  29.     print("Gagant : " + player_list[0])
  30.  
  31. nb_player = get_nb_players()
  32. player_list = setup(nb_player)
  33. kineto(nb_player, player_list)
Parsed in 0.011 seconds