adrénalice Posted January 17, 2021 Share Posted January 17, 2021 (edited) Hello, Quelqu'un a un programme qui marche pour le niveau 4* de ramasser des dominos, mon robot capte pas le "or" from robot import * for loop in range (3): for loop in range (10) : avancer() if not (surCroix() and surCroix()) or (surEtoile() and surEtoile()) or (surCarre()and surCarre()) : ramasserDomino() tournerDroite() tournerDroite() for loop in range (10) : avancer() tournerGauche() avancer() tournerGauche() En gros là y'a que les 2 croix qu'il ramasse pas Merciii pour votre aide Edit : c'est la Partie 1 de "ramasser des dominos" Edited January 17, 2021 by jePASSparla Quote Link to comment Share on other sites More sharing options...
Solution Shrex Posted January 17, 2021 Solution Share Posted January 17, 2021 (edited) Yo, from robot import * for loop in range(3): for loop in range(10): avancer() if surCarre() and (surCroix() or surEtoile()): ramasserDomino() elif surCroix() and surEtoile(): ramasserDomino() tournerDroite() tournerDroite() for loop in range(10): avancer() tournerGauche() avancer() tournerGauche() Edit : J'écrivais une réponse pour trouver le pb dans ton programme mais@DuTACKauTac est trop rapide !!! Edited January 17, 2021 by Lynk Sans-Visage and adrénalice 1 1 Quote Link to comment Share on other sites More sharing options...
Ancien du Bureau Sans-Visage Posted January 17, 2021 Ancien du Bureau Share Posted January 17, 2021 Salut! Je pense que c'est parce que ton "not" porte sur une seule condition. Je te propose d'essayer en rentrant ça: if not (surCroix() and surCroix()) or not (surEtoile() and surEtoile()) or not (surCarre()and surCarre()) : adrénalice and Shrex 1 1 Quote Link to comment Share on other sites More sharing options...
adrénalice Posted January 17, 2021 Author Share Posted January 17, 2021 Il y a 2 heures, DuTACKauTac a dit : if not (surCroix() and surCroix()) or not (surEtoile() and surEtoile()) or not (surCarre()and surCarre()) : je viens d'essayer ça il prend tout les dominos merci à vous !! Sans-Visage and Shrex 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.