Тёмный

Exercice corrigé 137: Création d'un Jeu de Morpion (Tic-Tac-Toe) 3x3 pour deux joueurs | Python 

Hassan EL BAHI
Подписаться 319 тыс.
Просмотров 9 тыс.
50% 1

Dans cette vidéo, nous allons écrire un programme qui permet d'implémenter le jeu 3×3 Tic-Tac-Toe (morpion) pour deux joueurs.
🗂️ Playlists :
Exercices corrigés en Python : bit.ly/3sdkB6s
Cours : bit.ly/3hyErDY
📌 Liens :
LinkedIn : / elbahihassan
Instagram : / hassan.el.bahi
Facebook page : / elbahihassanpage
Facebook groupe : / devcademy
Site Web: elbahihassan.com/

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 26   
@Zarek20
@Zarek20 8 месяцев назад
Que cette nouvelle année soit le début d'un chapitre exceptionnel pour chacun de nous . Bonne année à tous , que 2024 vous comble de bonheur et de réussite. En avant vers de nouvelles aventures ensemble ! 🎊🥳❤️ Premier commentaire ❤ depuis Belge
@ElbadaouyOtman-rd1ub
@ElbadaouyOtman-rd1ub 7 месяцев назад
أحسن أستاذ د لانفورماتيك شكرا ليك بزاف لله يحفظك كمل متوقفش ❤
@ibrahimasorybah9187
@ibrahimasorybah9187 8 месяцев назад
Merci bien, et nous sommes toujours à l'attente des autres parties de la série de formation (chaines de caractère, fichiers, POO, Data Science, IA, Web (django)).
@pitersonmarcena5713
@pitersonmarcena5713 8 месяцев назад
Merci cher Prof...Bonne fin d'année et heureuse année 2024 prof
@kemmounramzy6232
@kemmounramzy6232 8 месяцев назад
Allah ybaerk merci bcp monsieur allah yjazik
@koussailamessai7645
@koussailamessai7645 8 месяцев назад
Asseges ameges prof ❤
@user-xx1bh6do6o
@user-xx1bh6do6o 8 месяцев назад
top prof dyalna merci beaucoup.🤩
@Users7m647
@Users7m647 8 месяцев назад
Merci, professeur. Pouvez-vous expliquer certains bureaux de Python ? Merci
@ahmadkh-w5r
@ahmadkh-w5r 8 месяцев назад
Tu peut s’il te plais , faire des videos cours est exercice sur C# ?
@Laadimiayoub-e8f
@Laadimiayoub-e8f 8 месяцев назад
merci prof bonne annee
@aymanezahar3201
@aymanezahar3201 8 месяцев назад
Monsieur svp wach chara7 les fichiers f langage c?
@aminebouaddi3872
@aminebouaddi3872 8 месяцев назад
Happy new year prof 🥳🥳🥳
@منوعات-ظ8ه7ظ
@منوعات-ظ8ه7ظ 8 месяцев назад
Svp kml lina série dial les structures de données:graphes et arbres et merci d'avance ❤
@alan-d8p3b
@alan-d8p3b 7 месяцев назад
السلام عليكم استاد كاين هدا تمرين صعيب بزاف و حصلت فيه لكان دير فيديو عليه écrire un programme pour trouver la plus grande zone rectangulaire dans une matrice binaire (0 et 1) en deux dimensions. (doit utiliser des pointeurs) كتابة برنامج لإيجاد أكبر مساحة مستطيلة في مصفوفة (0 و 1) ثنائية الأبعاد. (يجب استخدام المؤشرات)
@serge_amon
@serge_amon 8 месяцев назад
Salut. Il est fortement déconseillé d'utiliser l'instruction global 😢
@mohamedamingana2154
@mohamedamingana2154 8 месяцев назад
متى ستقوم بكورس algorithme avancé ?
@coding-code00
@coding-code00 8 месяцев назад
completer les exercice plus comlique dans le langage c
@thawmat777
@thawmat777 8 месяцев назад
سنة سعيدة
@tahaaitelabbas
@tahaaitelabbas 7 месяцев назад
3zwa a oustade
@AyaGaboussa
@AyaGaboussa 8 месяцев назад
سلام عليكم استاذ من فضلك اكمل تنزيل الدروس في هياكل البيانات في سي بارك الله فيك.
@maryamtsu5839
@maryamtsu5839 8 месяцев назад
Salut monsieur t9dar t5dam m3ana langage c++ 😊
@Mimi_ahm
@Mimi_ahm 8 месяцев назад
سلام ممكن تساعديني في لغة c عندي projet ومش عارفه كيف احله
@akosyt4540
@akosyt4540 7 месяцев назад
​@@Mimi_ahmما هو السؤال
@abdoulayewade3514
@abdoulayewade3514 7 месяцев назад
Faire des vidéos sur java
@coding-code00
@coding-code00 8 месяцев назад
wa5a dir bha b langage c ir7am walidik
@montassarbenyahia9830
@montassarbenyahia9830 4 месяца назад
voila mon prog def afficher_plateau(plateau): """Affiche le plateau de jeu.""" for ligne in plateau: print("|".join(ligne)) print("-----") def verifier_victoire(plateau, symbole): """Vérifie s'il y a une victoire pour le symbole donné.""" # Vérification des lignes for ligne in plateau: if all(case == symbole for case in ligne): return True # Vérification des colonnes for colonne in range(3): if all(plateau[ligne][colonne] == symbole for ligne in range(3)): return True # Vérification des diagonales if plateau[0][0] == plateau[1][1] == plateau[2][2] == symbole: return True if plateau[0][2] == plateau[1][1] == plateau[2][0] == symbole: return True return False def jeu_tic_tac_toe(): """Fonction principale pour jouer au Tic-Tac-Toe.""" plateau = [[" " for _ in range(3)] for _ in range(3)] symboles = ["X", "O"] joueur = 0 # Joueur 1 commence while True: afficher_plateau(plateau) print(f"C'est au joueur {joueur + 1} ({symboles[joueur]}) de jouer.") # Demander au joueur de choisir une position while True: try: ligne = int(input("Choisissez la ligne (1-3) : ")) - 1 colonne = int(input("Choisissez la colonne (1-3) : ")) - 1 if plateau[ligne][colonne] == " ": plateau[ligne][colonne] = symboles[joueur] break else: print("Cette case est déjà occupée. Choisissez une autre position.") except (ValueError, IndexError): print("Entrée invalide. Veuillez saisir un nombre entre 1 et 3.") # Vérifier s'il y a une victoire if verifier_victoire(plateau, symboles[joueur]): afficher_plateau(plateau) print(f"Le joueur {joueur + 1} ({symboles[joueur]}) remporte la partie !") break # Vérifier s'il y a une égalité if all(plateau[ligne][colonne] != " " for ligne in range(3) for colonne in range(3)): afficher_plateau(plateau) print("Match nul !") break # Passer au joueur suivant joueur = (joueur + 1) % 2 # Lancer le jeu jeu_tic_tac_toe()
Далее
Дежавю, прескевю и жамевю!
00:59
Просмотров 198 тыс.
Python : Les dictionnaires
10:28
Просмотров 24 тыс.
Coding Was HARD Until I Learned These 5 Things...
8:34
If __name__ == "__main__" for Python Developers
8:47
Просмотров 401 тыс.
C++ Developer Learns Python
9:26
Просмотров 2,7 млн