Spaces:
Running
Running
Create a user-friendly HTML animation on this topic, in French [Voici un **cours clair et pédagogique en français** sur le **concept de *statement* en COBOL**, avec la **traduction du terme**, des **explications progressives**, et des **exemples commentés**, parfaitement adapté aux **débutants**.
8198c28 verified Download examples.html from Robertuk/cobol-command-carnival: direct link, hf CLI and curl.
- Browser
- Download file 5.27 kB
-
https://huggingface.co/spaces/Robertuk/cobol-command-carnival/resolve/main/examples.html
- Command line
-
hf download hf://spaces/Robertuk/cobol-command-carnival/examples.html
-
curl -L -o examples.html https://huggingface.co/spaces/Robertuk/cobol-command-carnival/resolve/main/examples.html
5.27 kB
| <html lang="fr"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Exemples COBOL</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <custom-navbar></custom-navbar> | |
| <main class="container mx-auto px-4 py-8 max-w-4xl"> | |
| <header class="text-center mb-12"> | |
| <h1 class="text-4xl font-bold text-primary-500 mb-4">📚 Exemples COBOL</h1> | |
| <p class="text-xl text-gray-600">Apprenez par la pratique avec ces exemples commentés</p> | |
| </header> | |
| <section class="bg-white rounded-xl shadow-lg p-6 mb-8 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">💡 Exemple 1 : Hello World</h2> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-green-400 font-mono text-sm"><code> IDENTIFICATION DIVISION. | |
| PROGRAM-ID. HELLO. | |
| PROCEDURE DIVISION. | |
| DISPLAY "Hello World". | |
| STOP RUN.</code></pre> | |
| </div> | |
| <div class="mt-4 space-y-2"> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">1</div> | |
| <p class="text-sm">Programme minimal avec une seule instruction <code>DISPLAY</code></p> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="bg-white rounded-xl shadow-lg p-6 mb-8 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">💡 Exemple 2 : Calcul simple</h2> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-green-400 font-mono text-sm"><code> IDENTIFICATION DIVISION. | |
| PROGRAM-ID. CALCUL. | |
| DATA DIVISION. | |
| WORKING-STORAGE SECTION. | |
| 01 NOMBRE1 PIC 9(3) VALUE 100. | |
| 01 NOMBRE2 PIC 9(3) VALUE 50. | |
| 01 RESULTAT PIC 9(4). | |
| PROCEDURE DIVISION. | |
| ADD NOMBRE1 TO NOMBRE2 GIVING RESULTAT. | |
| DISPLAY "Résultat: " RESULTAT. | |
| STOP RUN.</code></pre> | |
| </div> | |
| <div class="mt-4 space-y-2"> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">1</div> | |
| <p class="text-sm">Déclaration des variables dans la <code>DATA DIVISION</code></p> | |
| </div> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">2</div> | |
| <p class="text-sm">Instruction <code>ADD</code> pour effectuer un calcul</p> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="bg-white rounded-xl shadow-lg p-6 mb-8 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">💡 Exemple 3 : Condition IF</h2> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-green-400 font-mono text-sm"><code> IDENTIFICATION DIVISION. | |
| PROGRAM-ID. CONDITION. | |
| DATA DIVISION. | |
| WORKING-STORAGE SECTION. | |
| 01 AGE PIC 9(3) VALUE 18. | |
| PROCEDURE DIVISION. | |
| IF AGE >= 18 | |
| DISPLAY "Majeur" | |
| ELSE | |
| DISPLAY "Mineur" | |
| END-IF. | |
| STOP RUN.</code></pre> | |
| </div> | |
| <div class="mt-4 space-y-2"> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">1</div> | |
| <p class="text-sm">Structure conditionnelle avec <code>IF-ELSE-END-IF</code></p> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="bg-white rounded-xl shadow-lg p-6 animate-fade-in"> | |
| <h2 class="text-2xl font-semibold text-secondary-500 mb-4">💡 Exemple 4 : Boucle PERFORM</h2> | |
| <div class="bg-gray-800 rounded-lg p-4 overflow-x-auto"> | |
| <pre class="text-green-400 font-mono text-sm"><code> IDENTIFICATION DIVISION. | |
| PROGRAM-ID. BOUCLE. | |
| DATA DIVISION. | |
| WORKING-STORAGE SECTION. | |
| 01 COMPTEUR PIC 9(2) VALUE 1. | |
| PROCEDURE DIVISION. | |
| PERFORM VARYING COMPTEUR FROM 1 BY 1 | |
| UNTIL COMPTEUR > 10 | |
| DISPLAY "Compteur: " COMPTEUR | |
| END-PERFORM. | |
| STOP RUN.</code></pre> | |
| </div> | |
| <div class="mt-4 space-y-2"> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 text-blue-800 px-2 py-1 rounded-full text-xs mr-2">1</div> | |
| <p class="text-sm">Boucle avec <code>PERFORM VARYING</code></p> | |
| </div> | |
| </div> | |
| </section> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| <script src="script.js"></script> | |
| <script>feather.replace();</script> | |
| </body> | |
| </html> |