letartare06 Posted February 1 Posted February 1 salut je ne comprends pas pq mon programme compte qu'une fois les dominos et j'ai réussi à rectifier mais ça me fais 36 block de plus. ``` from robot import * nbrCa=0 nbrE=0 nbrCr=0 for loop in range(8): avancer() if surCarre() and surCroix(): nbrCa=nbrCa+1 nbrCr=nbrCr+1 if surCarre() and surEtoile(): nbrCa=nbrCa+1 nbrE=nbrE+1 if surCarre and surCarre: nbrCa=nbrCa+2 if surEtoile() and surEtoile(): nbrE=nbrE+2 if surEtoile() and surCroix(): nbrE=nbrE+1 nbrCr=nbrCr+1 if surCroix() and surCroix(): nbrCr=nbrCr+2 avancer() avancer() if nbrCa > (nbrE and nbrCr): ecrireNombre(nbrCa) if nbrCr >(nbrE and nbrCa): ecrireNombre(nbrCr) if nbrE >(nbrCa and nbrCr): ecrireNombre(nbrE) ``` celui la c'est celui qui à 36 block de plus normalement il fonctionne mais du coup il a trop de block de plus https://ibb.co/kVXdp7gH https://ibb.co/z3xC7pg Merciii Quote
Ancien Responsable Matière Bastitine Posted 2 hours ago Ancien Responsable Matière Posted 2 hours ago Salut @letartare06, je ne sais pas si tu as réussi depuis, mais il est vrai que cet exercice est vraiment dur et limité en blocs. Je te laisse mon programme qui fait pile 70 blocs : ca=0 et=0 cr=0 for i in range(9): avancer() if surCarre(): ca+=1 if not (surCroix() or surEtoile()): ca+=1 if surCroix(): cr+=1 if not (surCarre() or surEtoile()): cr+=1 if surEtoile(): et+=1 if not (surCarre() or surCroix()): et+=1 avancer() a=et if a < ca : a = ca if a < cr : a = cr ecrireNombre(a) N'hésite pas si tu as des questions ! Quote
letartare06 Posted 2 hours ago Author Posted 2 hours ago (edited) il y a 24 minutes, Bastitine a dit : Salut @letartare06, je ne sais pas si tu as réussi depuis, mais il est vrai que cet exercice est vraiment dur et limité en blocs. Je te laisse mon programme qui fait pile 70 blocs : ca=0 et=0 cr=0 for i in range(9): avancer() if surCarre(): ca+=1 if not (surCroix() or surEtoile()): ca+=1 if surCroix(): cr+=1 if not (surCarre() or surEtoile()): cr+=1 if surEtoile(): et+=1 if not (surCarre() or surCroix()): et+=1 avancer() a=et if a < ca : a = ca if a < cr : a = cr ecrireNombre(a) N'hésite pas si tu as des questions ! Oui j'avais réussi mais Merciii bcp quand même Edited 2 hours ago by letartare06 Bastitine 1 Quote
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.