BESOIN D'AIDE SUR BASIC
tundra12
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
Nico# Messages postés 338 Statut Membre -
Nico# Messages postés 338 Statut Membre -
Bonjour,
Y aurait-il un bon samaritain qui pourrait me resoudre ceci (pour un projet de Geocaching)
Merci
10 REMARQUE "*** Les variables «A», «B», «C», «D», «E» et «F» ci-dessous doivent prendre la valeur des coordonnées de la cache du cours «Informatique 101».
20 LAISSE A = 45
30 LAISSE B = 41
40 LAISSE C = 444
50 LAISSE D = 73
60 LAISSE E = 53
70 LAISSE F = 764
80 REMARQUE
90 LAISSE Tri$ = "Tri bulles"
100 ALLER-RETOUR À 630
110 LAISSE Tests = 0
120 LAISSE Permutations = 0
130 LAISSE Limite = 6
140 POUR Premier_Indice = 1 JUSQU'À Limite SAUT 1
150 LAISSE Tests = Tests + 1
160 SI Noms$[Premier_Indice + 1] > Noms$[Premier_Indice] ALORS ALLER À 210 FINSI
170 LAISSE Permutations = Permutations + 1
180 LAISSE Temporaire$ = Noms$[Premier_Indice]
190 LAISSE Noms$[Premier_Indice] = Noms$[Premier_Indice + 1]
200 LAISSE Noms$[Premier_Indice + 1] = Temporaire$
210 SUIVANT Premier_Indice
220 LAISSE Limite = Limite - 1
230 SI Limite > 1 ALORS ALLER À 140 FINSI
240 ALLER-RETOUR À 740
250 LAISSE Tests_Bulle = Tests
260 LAISSE Permutations_Bulle = Permutations
270 REMARQUE
280 LAISSE Tri$ = "Tri Shell"
290 ALLER-RETOUR À 630
300 LAISSE Tests = 0
310 LAISSE Permutations = 0
320 LAISSE Intervalle = 4
330 POUR Premier_Indice = Intervalle + 1 JUSQU'À 7 SAUT Intervalle
340 LAISSE Deuxieme_Indice = Premier_Indice
350 LAISSE Troisieme_Indice = Deuxieme_Indice - Intervalle
360 RÉPÉTER
370 LAISSE Tests = Tests + 1
380 SI Noms$[Troisieme_Indice] <= Noms$[Deuxieme_Indice] ALORS SORTIR À 460
390 LAISSE Permutations = Permutations + 1
400 LAISSE Temporaire$ = Noms$[Deuxieme_Indice]
410 LAISSE Noms$[Deuxieme_Indice] = Noms$[Troisieme_Indice]
420 LAISSE Noms$[Troisieme_Indice] = Temporaire$
430 LAISSE Deuxieme_Indice = Deuxieme_Indice - Intervalle
440 LAISSE Troisieme_Indice = Troisieme_Indice - Intervalle
450 JUSQU'À CE QUE Troisieme_Indice < 1
460 SUIVANT Premier_Indice
470 SI Intervalle = 4 ALORS LAISSE Intervalle = 2; ALLER À 330 FINSI
480 SI Intervalle = 2 ALORS LAISSE Intervalle = 1; ALLER À 330 FINSI
490 ALLER-RETOUR À 740
500 LAISSE Tests_Shell = Tests
510 LAISSE Permutations_Shell = Permutations
520 REMARQUE
530 LAISSE Degres_Latitude_201 = A
540 LAISSE Minutes_Latitude_201 = B - Permutations_Bulle + Permutations_Shell
550 SI Tests_Shell > Tests_Bulle ALORS LAISSE Milliemes_Latitude_201 = F - E SINON LAISSE Milliemes_Latitude_201 = F - B - Tests_Bulle - Permutations_Shell FINSI
560 LAISSE Degres_Longitude_201 = D
570 LAISSE Minutes_Longitude_201 = Tests_Bulle * 1.5 + Tests_Shell + Permutations_Shell
580 SI Tests_Bulle + Permutations_Shell > Tests_Shell + Permutations_Bulle ALORS LAISSE Milliemes_Longitude_201 = D + E + A - B SINON LAISSE Milliemes_Longitude_201 = D + A + Tests_Bulle + Permutations_Shell FINSI
590 REMARQUE
600 IMPRIME "Les coordonnées de la cache sont : N",Degres_Latitude_201,"° ",Minutes_Latitude_201,".",Milliemes_Latitude_201," W",Degres_Longitude_201,"° ",Minutes_Longitude_201,".",Milliemes_Longitude_201
610 FIN
620 REMARQUE
630 REMARQUE "*** Initialisation des noms de géocacheurs à trier
640 DIMENSIONNE Noms$[1:7]
650 LAISSE Noms$[1] = "Misouris"
660 LAISSE Noms$[2] = "Unoyt"
670 LAISSE Noms$[3] = "Big JohnP"
680 LAISSE Noms$[4] = "OpusTerra"
690 LAISSE Noms$[5] = "Ze Team Bebenoir"
700 LAISSE Noms$[6] = "Wallaby77"
710 LAISSE Noms$[7] = "L'Exocet"
720 RETOUR
730 REMARQUE
740 REMARQUE "*** Impression des résultats du tri
750 POUR Premier_Indice = 1 JUSQU'À 7 SAUT 1
760 IMPRIME Noms$[Premier_Indice]
770 SUIVANT Premier_Indice
780 IMPRIME "Nombre de tests (",Tri$,"): ",Tests
790 IMPRIME "Nombre de permutations (",Tri$,"): ",Permutations
800 IMPRIME "*****************************************"
810 RETOUR
Y aurait-il un bon samaritain qui pourrait me resoudre ceci (pour un projet de Geocaching)
Merci
10 REMARQUE "*** Les variables «A», «B», «C», «D», «E» et «F» ci-dessous doivent prendre la valeur des coordonnées de la cache du cours «Informatique 101».
20 LAISSE A = 45
30 LAISSE B = 41
40 LAISSE C = 444
50 LAISSE D = 73
60 LAISSE E = 53
70 LAISSE F = 764
80 REMARQUE
90 LAISSE Tri$ = "Tri bulles"
100 ALLER-RETOUR À 630
110 LAISSE Tests = 0
120 LAISSE Permutations = 0
130 LAISSE Limite = 6
140 POUR Premier_Indice = 1 JUSQU'À Limite SAUT 1
150 LAISSE Tests = Tests + 1
160 SI Noms$[Premier_Indice + 1] > Noms$[Premier_Indice] ALORS ALLER À 210 FINSI
170 LAISSE Permutations = Permutations + 1
180 LAISSE Temporaire$ = Noms$[Premier_Indice]
190 LAISSE Noms$[Premier_Indice] = Noms$[Premier_Indice + 1]
200 LAISSE Noms$[Premier_Indice + 1] = Temporaire$
210 SUIVANT Premier_Indice
220 LAISSE Limite = Limite - 1
230 SI Limite > 1 ALORS ALLER À 140 FINSI
240 ALLER-RETOUR À 740
250 LAISSE Tests_Bulle = Tests
260 LAISSE Permutations_Bulle = Permutations
270 REMARQUE
280 LAISSE Tri$ = "Tri Shell"
290 ALLER-RETOUR À 630
300 LAISSE Tests = 0
310 LAISSE Permutations = 0
320 LAISSE Intervalle = 4
330 POUR Premier_Indice = Intervalle + 1 JUSQU'À 7 SAUT Intervalle
340 LAISSE Deuxieme_Indice = Premier_Indice
350 LAISSE Troisieme_Indice = Deuxieme_Indice - Intervalle
360 RÉPÉTER
370 LAISSE Tests = Tests + 1
380 SI Noms$[Troisieme_Indice] <= Noms$[Deuxieme_Indice] ALORS SORTIR À 460
390 LAISSE Permutations = Permutations + 1
400 LAISSE Temporaire$ = Noms$[Deuxieme_Indice]
410 LAISSE Noms$[Deuxieme_Indice] = Noms$[Troisieme_Indice]
420 LAISSE Noms$[Troisieme_Indice] = Temporaire$
430 LAISSE Deuxieme_Indice = Deuxieme_Indice - Intervalle
440 LAISSE Troisieme_Indice = Troisieme_Indice - Intervalle
450 JUSQU'À CE QUE Troisieme_Indice < 1
460 SUIVANT Premier_Indice
470 SI Intervalle = 4 ALORS LAISSE Intervalle = 2; ALLER À 330 FINSI
480 SI Intervalle = 2 ALORS LAISSE Intervalle = 1; ALLER À 330 FINSI
490 ALLER-RETOUR À 740
500 LAISSE Tests_Shell = Tests
510 LAISSE Permutations_Shell = Permutations
520 REMARQUE
530 LAISSE Degres_Latitude_201 = A
540 LAISSE Minutes_Latitude_201 = B - Permutations_Bulle + Permutations_Shell
550 SI Tests_Shell > Tests_Bulle ALORS LAISSE Milliemes_Latitude_201 = F - E SINON LAISSE Milliemes_Latitude_201 = F - B - Tests_Bulle - Permutations_Shell FINSI
560 LAISSE Degres_Longitude_201 = D
570 LAISSE Minutes_Longitude_201 = Tests_Bulle * 1.5 + Tests_Shell + Permutations_Shell
580 SI Tests_Bulle + Permutations_Shell > Tests_Shell + Permutations_Bulle ALORS LAISSE Milliemes_Longitude_201 = D + E + A - B SINON LAISSE Milliemes_Longitude_201 = D + A + Tests_Bulle + Permutations_Shell FINSI
590 REMARQUE
600 IMPRIME "Les coordonnées de la cache sont : N",Degres_Latitude_201,"° ",Minutes_Latitude_201,".",Milliemes_Latitude_201," W",Degres_Longitude_201,"° ",Minutes_Longitude_201,".",Milliemes_Longitude_201
610 FIN
620 REMARQUE
630 REMARQUE "*** Initialisation des noms de géocacheurs à trier
640 DIMENSIONNE Noms$[1:7]
650 LAISSE Noms$[1] = "Misouris"
660 LAISSE Noms$[2] = "Unoyt"
670 LAISSE Noms$[3] = "Big JohnP"
680 LAISSE Noms$[4] = "OpusTerra"
690 LAISSE Noms$[5] = "Ze Team Bebenoir"
700 LAISSE Noms$[6] = "Wallaby77"
710 LAISSE Noms$[7] = "L'Exocet"
720 RETOUR
730 REMARQUE
740 REMARQUE "*** Impression des résultats du tri
750 POUR Premier_Indice = 1 JUSQU'À 7 SAUT 1
760 IMPRIME Noms$[Premier_Indice]
770 SUIVANT Premier_Indice
780 IMPRIME "Nombre de tests (",Tri$,"): ",Tests
790 IMPRIME "Nombre de permutations (",Tri$,"): ",Permutations
800 IMPRIME "*****************************************"
810 RETOUR
A voir également:
- BESOIN D'AIDE SUR BASIC
- Microsoft 365 basic - Accueil - Microsoft Office
- Visual basic - Télécharger - Langages
- File renamer basic - Télécharger - Gestion de fichiers
- Visual basic editor - Télécharger - Langages
- Quick basic - Télécharger - Édition & Programmation