je voudrais savoir ou se trouve ma faute
1 VARIABLES
2 a EST_DU_TYPE NOMBRE
3 b EST_DU_TYPE NOMBRE
4 DEBUT_ALGORITHME
5 POUR a ALLANT_DE -40 A -30
6 DEBUT_POUR
7 POUR b ALLANT_DE -40 A 40
8 DEBUT_POUR
9 TRACER_POINT (a,b)
10 FIN_POUR
11 FIN_POUR
12 POUR a ALLANT_DE -30 A 0
13 DEBUT_POUR
14 POUR b ALLANT_DE 0 A 40
15 DEBUT_POUR
16 SI (b>=-a ET b<=-a+10) ALORS
17 DEBUT_SI
18 TRACER_POINT (a,b)
19 FIN_SI
20 FIN_POUR
21 FIN_POUR
22 FIN_ALGORITHME
Bonjour, il marche ton algorithme. As-tu bien réglé la fenêtre graphique avec des x entre -40 et 0 et des y entre -50 et 50 ?
ça dessine ça :
Si le premier voulait être un 1, la barre oblique est du mauvais coté.
tu as bien su créer cet algorithme, lance toi pour faire un 4. C'est le même principe. Fais chaque barre avec des boucles.
je suis bloqué je ne comprend pourquoi cela ne se relie pas:?
Code de l'algorithme
1 VARIABLES
2 a EST_DU_TYPE NOMBRE
3 b EST_DU_TYPE NOMBRE
4 DEBUT_ALGORITHME
5 POUR a ALLANT_DE -40 A -30
6 DEBUT_POUR
7 POUR b ALLANT_DE -40 A 40
8 DEBUT_POUR
9 TRACER_POINT (a,b)
10 FIN_POUR
11 FIN_POUR
12 POUR a ALLANT_DE -30 A 0
13 DEBUT_POUR
14 POUR b ALLANT_DE 0 A 40
15 DEBUT_POUR
16 SI (b>=-a ET b<=-a+10) ALORS
17 DEBUT_SI
18 TRACER_POINT (b,a)
19 TRACER_POINT (a,b)
20 FIN_SI
21 FIN_POUR
22 FIN_POUR
23 FIN_ALGORITHME
ok maintenant j'en suis la mais je n'arrive pas à faire apparaître la petite barre du 4
VARIABLES
2 a EST_DU_TYPE NOMBRE
3 b EST_DU_TYPE NOMBRE
4 DEBUT_ALGORITHME
5 POUR a ALLANT_DE -40 A -30
6 DEBUT_POUR
7 POUR b ALLANT_DE -40 A 40
8 DEBUT_POUR
9 TRACER_POINT (a,b)
10 FIN_POUR
11 FIN_POUR
12 POUR a ALLANT_DE -30 A 0
13 DEBUT_POUR
14 POUR b ALLANT_DE 0 A 40
15 DEBUT_POUR
16 SI (b>=-a ET b<=-a+10) ALORS
17 DEBUT_SI
18 TRACER_POINT (b,a)
19 TRACER_POINT (a,b)
20 FIN_SI
21 SI (b>=a ET b<=a+10) ALORS
22 DEBUT_SI
23 TRACER_POINT (-a,b)
24 FIN_SI
25 FIN_POUR
26 FIN_POUR
27 FIN_ALGORITHME
regarde comment est fait un 4. tu as une barre horizontale, une barre verticale, et une barre oblique.
disons que la barre horizontale va de 0 à 40 et la barre verticale de 30 à 35 et va de 0 à 35, ça donne les deux premières étapes.
Après essaye de trouver un truc pour dessiner la barre oblique. (avec des équations de droite par exemple, c'est la seule partie un peu difficile).
je t'ai fait un exemple :
(tu peux le copier/coller dans algobox en mode éditeur de texte, ou bien directement en ligne dans proglab )
VARIABLES
a EST_DU_TYPE NOMBRE
b EST_DU_TYPE NOMBRE
c EST_DU_TYPE NOMBRE
DEBUT_ALGORITHME
POUR a ALLANT_DE 0 A 40
DEBUT_POUR
POUR b ALLANT_DE 0 A 5
DEBUT_POUR
TRACER_POINT (a,b)
FIN_POUR
FIN_POUR
POUR a ALLANT_DE 30 A 35
DEBUT_POUR
POUR b ALLANT_DE -5 A 35
DEBUT_POUR
TRACER_POINT (a,b)
FIN_POUR
FIN_POUR
POUR c ALLANT_DE 0 A 5
DEBUT_POUR
POUR a ALLANT_DE 0 A 30
DEBUT_POUR
b PREND_LA_VALEUR a+5-c
TRACER_POINT (a,b)
FIN_POUR
FIN_POUR
FIN_ALGORITHME
voila j'en suis arrive lamais le probleme c'est que la barre du 4 reste trop grandre de plus je ne vous l'avez pas dit mais c'est lautre type de 4 qui faut faire
Code de l'algorithme
1 VARIABLES
2 a EST_DU_TYPE NOMBRE
3 b EST_DU_TYPE NOMBRE
4 c EST_DU_TYPE NOMBRE
5 DEBUT_ALGORITHME
6 POUR a ALLANT_DE -40 A -30
7 DEBUT_POUR
8 POUR b ALLANT_DE -40 A 40
9 DEBUT_POUR
10 TRACER_POINT (a,b)
11 POUR c ALLANT_DE -20 A -10
12 DEBUT_POUR
13 TRACER_POINT (b,c)
14 FIN_POUR
15 FIN_POUR
16 FIN_POUR
17 POUR a ALLANT_DE -30 A 0
18 DEBUT_POUR
19 POUR b ALLANT_DE 0 A 40
20 DEBUT_POUR
21 POUR c ALLANT_DE -10 A 0
22 DEBUT_POUR
23 SI (c>=-b ET c<=-b+10) ALORS
24 DEBUT_SI
25 TRACER_POINT (c,b)
26 FIN_SI
27 FIN_POUR
28 SI (b>=-a ET b<=-a+10) ALORS
29 DEBUT_SI
30 TRACER_POINT (b,a)
31 TRACER_POINT (a,b)
32 FIN_SI
33 SI (b>=a ET b<=a+10) ALORS
34 DEBUT_SI
35 TRACER_POINT (-a,b)
36 FIN_SI
37 FIN_POUR
38 FIN_POUR
39 FIN_ALGORITHME
voici mon nouveau 4
1 VARIABLES
2 a EST_DU_TYPE NOMBRE
3 b EST_DU_TYPE NOMBRE
4 c EST_DU_TYPE NOMBRE
5 d EST_DU_TYPE NOMBRE
6 DEBUT_ALGORITHME
7 POUR a ALLANT_DE -40 A -30
8 DEBUT_POUR
9 POUR b ALLANT_DE -40 A 40
10 DEBUT_POUR
11 TRACER_POINT (a,b)
12 POUR c ALLANT_DE -20 A -15
13 DEBUT_POUR
14 POUR d ALLANT_DE -50 A 5
15 DEBUT_POUR
16 TRACER_POINT (d,c)
17 FIN_POUR
18 FIN_POUR
19 FIN_POUR
20 FIN_POUR
21 POUR a ALLANT_DE -30 A 0
22 DEBUT_POUR
23 POUR b ALLANT_DE 0 A 40
24 DEBUT_POUR
25 SI (b>=-a ET b<=-a+10) ALORS
26 DEBUT_SI
27 TRACER_POINT (b,a)
28 TRACER_POINT (a,b)
29 FIN_SI
30 SI (b>=a ET b<=a+10) ALORS
31 DEBUT_SI
32 TRACER_POINT (-a,b)
33 FIN_SI
34 FIN_POUR
35 FIN_POUR
36 FIN_ALGORITHME
Oui c'est quoi ta question ?
il est toujours à l'envers.
(et j'en est un peu marre de faire tourner tes algorithmes de plus en plus compliqués (d'autant que tu laisses les numéros de ligne et que je suis obligé de les enlever à chaque fois)); je t'ai donné un exemple assez simple.
Vous devez être membre accéder à ce service...
Pas encore inscrit ?
1 compte par personne, multi-compte interdit !
Ou identifiez-vous :