add choose level and correct spelling

This commit is contained in:
Mat 2023-02-13 19:27:55 +01:00
parent 29b73a31b3
commit 4608208b7f

View File

@ -3,34 +3,48 @@ game = True
while game: while game:
print('Bienvenue dans le jeu cat puzzle') print('Bienvenue dans le jeu cat puzzle')
print('Decouvrons ensemeble le premier niveau') #make a first level choose_level = 0
level_one = [(1,1,1),(1,1,0),(1,1,1)] while choose_level == 0:
print(level_one[0]) choose_level = input('Choissisez un niveau à résoudre\n') #choose a level of the game
print(level_one[1]) try:
print(level_one[2]) choose_level = int(choose_level)
except ValueError:
choose_level= 0
print('Il me faut un nombre')
if choose_level!=1:
choose_level = 0
print('Il n\'existe que le niveau 1 pour l\'instant')
print('Découvrons ensemeble le niveau',choose_level) #make a first level
if choose_level ==1: #select the level one and print it
level_one = [(1,1,1),(1,1,0),(1,1,1)]
print(level_one[0])
print(level_one[1])
print(level_one[2])
print('Voila les piece que vous disposez pour completer le puzzle') #make piece for resolve the puzzle print('Voilà les pièces que vous disposez pour complèter le puzzle') #make piece for resolve the puzzle
nbr_piece = 3 nbr_piece = 3
piece_one = [(1,1),(1,0)] piece_one = [(1,1),(1,0)]
piece_two = [(1,0),(1,0),(1,0)] piece_two = [(1,0),(1,0),(1,0)]
piece_three = [(1,1)] piece_three = [(1,1)]
print('Voila la piece 1:') #show the piece at the player print('Voilà la pièce 1:') #show the piece at the player
for i in piece_one: for i in piece_one:
print(i) print(i)
print('Voila la piece 2:') print('Voilà la pièce 2:')
for i in piece_two: for i in piece_two:
print(i) print(i)
print('Voila la piece 3:') print('Voilà la pièce 3:')
for i in piece_three: for i in piece_three:
print(i) print(i)
choose_piece = 0 choose_piece = 0
while choose_piece ==0: while choose_piece ==0:
choose_piece = input('Choissisez la piece que vous voulez bouger ? ') #choice of the piece to move choose_piece = input('Choissisez la pièce que vous voulez bouger ? ') #choice of the piece to move
try: try:
choose_piece = int(choose_piece) choose_piece = int(choose_piece)
except ValueError: except ValueError: