KreeZe

test jeu simplifié

Nov 17th, 2019
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2. list_2[["l'Entrée","le Salon","la Salle a manger","la Salle de jeu","la Salle de reception","la Cuisine","la Chambre"],
  3. ["l'Entrée","le Salon","la Salle a manger","la Salle de jeu","la Salle de reception","la Cuisine","la Chambre"],
  4. ["vous avez avancé","vous avez été à gauche","vous avez reculé","vous avez été a droite","erreur","Au revoir"],
  5. ["Couteau","Chandelier","Clé anglaise","Matraque"],
  6. ["Revolver","Corde","Montre", "Appareil Photo","Ecouteur","Pendentifs"],
  7. ["le major-d'home","le policier","le cuisinier","le mécano"],
  8. ["Chandelier.png","Matraque.png","Couteau.png","clef.png"]
  9. ]
  10. """
  11.  
  12. #bibliothèque
  13. from random import*
  14.  
  15. #liste
  16. piece_direction = [ ["l'Entrée",[1,0,0,0]],
  17. ["le Salon",[4,2,0,3]],
  18. ["la Salle a manger",[5,2,2,1]],
  19. ["la Salle de jeu",[6,1,3,3]],
  20. ["la Salle de reception",[4,5,1,6]],
  21. ["la Cuisine",[5,5,2,4]],
  22. ["la Chambre",[6,4,3,6]]
  23. ]
  24.  
  25. indice_main_sec = [ ["Couteau","Chandelier","Clé anglaise","Matraque"],
  26. ["Revolver","Corde","Montre", "Appareil Photo","Ecouteur","Pendentifs"] ]
  27.  
  28. presence_list = ["l'Entrée","le Salon","la Salle a manger","la Salle de jeu","la Salle de reception","la Cuisine","la Chambre"]
  29.  
  30. #fonction choix random (sortie indice_I/II/III et presence_I/II/III)
  31. def indice(nombre,nombreROMAIN,numero):
  32. if nombre == 1 :
  33. nombre_indice = randint(0,3-numero)
  34. nombreROMAIN_indice = indice_main_sec[0][nombre_indice]
  35. return nombreROMAIN_indice
  36. else:
  37. nombre_indice = randint(0,5-numero)
  38. nombreROMAIN_indice = indice_main_sec[1][nombre_indice]
  39. del indice_main_sec[1][nombre_indice]
  40. return nombreROMAIN_indice
  41.  
  42. def presence(nombre,nombreROMAIN,numero):
  43. nombre_presence = randint(1,6-numero)
  44. nombreROMAIN_presence = presence_list[nombre_presence]
  45. del presence_list[nombre_presence]
  46. return nombreROMAIN_presence
  47.  
  48.  
  49. #fonction main (jeu)
  50. def main():
  51. points_1 = 0
  52. points_2 = 0
  53. points_3 = 0
  54. position = 0
  55. continuer = 0
  56. emplacement = 0
  57. touche = ''
  58. #affectation indice et presence
  59. indice_I = indice(1,"I",0)
  60. indice_II = indice(2,"II",0)
  61. indice_III = indice(3,"III",1)
  62.  
  63. presence_I = presence(1,"I",0)
  64. presence_II = presence(2,"II",1)
  65. presence_III = presence(3,"III",2)
  66.  
  67. while continuer == 0:
  68. #detection touche
  69. touche = str(input("choix"))
  70.  
  71. #mechanisme de jeu
  72. if touche == "z":
  73. position = piece_direction[position][1][0]
  74. elif touche == "q":
  75. position = piece_direction[position][1][1]
  76. elif touche == "s":
  77. position = piece_direction[position][1][2]
  78. elif touche == "d":
  79. position = piece_direction[position][1][3]
  80. elif touche == "Q":
  81. continuer = 1
  82. emplacement = piece_direction[position][0]+".png"
  83. print("image de : "+emplacement)
  84.  
  85. #decouverte indice
  86. if piece_direction[position][0] == presence_I:
  87. print("image de : "+emplacement)
  88. print("vous avez trouvé un indice : "+indice_I)
  89. points_1=1
  90. if piece_direction[position][0] == presence_II:
  91. print("image de : "+emplacement)
  92. print("vous avez trouvé un indice : "+indice_II)
  93. points_2=1
  94. if piece_direction[position][0] == presence_III:
  95. print("image de : "+emplacement)
  96. print("vous avez trouvé un indice : "+indice_III)
  97. points_3=1
  98.  
  99. #fin 1ère phase
  100. if (points_1+points_2+points_3) == 3:
  101. print(points_1+points_2+points_3)
  102. continuer = 1
  103.  
  104.  
  105. main()
RAW Paste Data