Welcome to Coding : Sécurité Programmation Réseaux

Search   in  

 Create an Account Home | Submit News Your Account Content | Topics | Top 10  


Accueil
· Home
· Listing des Articles
· Top 10
· Repository des Exploits

Les sujets / parties
· C / C ++
· Visual Basic
· Asm
· Reseaux
· Java
· Securite
· Divers

Utile
· Listing des Articles

· Telecharger
· Le Forum
· Liens
· Proposer un article

Top20 des Downloads
· 1: Etude des reseaux generalites et protocoles
· 2: Cheval de troie en VB avec sources
· 3: Netcat 1.1
· 4: Keylogger
· 5: Etudes des reseaux hauts debits architectures et protocoles
· 6: Ecoute de port
· 7: Etude du Smart Spoofing
· 8: Win Packet Capture Utils
· 9: Tutorial on Traffic Interception on Switched Lan using ARP spoofing
· 10: Cours de C

User Info
Welcome, Anonymous
Nickname
Password
(Register)
Membership:
Latest: trapcodien
New Today: 1
New Yesterday: 0
Overall: 2207

People Online:
Visitors: 42
Members: 1
Total: 43

Online Now:
01: trapcodien

  
News: Programme de codage en morse (langage : ADA95)
Posted on Friday, November 21 @ 12:32:13 CET
Topic: Ada
Ada

	Voila un coder de morse en ADA, il permet d' illuistrer simplement comment fonctionne ce langage, qui s'avere etre a mon avis interessant mais un peu contraignant au niveau de la programmation. Pour la source voyez la suite ...

--| Programme de codage en Morse --| Entree : un texte termine par '$' --| Sortie : le codage en Morse du texte with Ada.Text_IO; use Ada.Text_IO; procedure Coder is Dernier : constant Character := '$'; -- fin du texte en entree -- Lecture de caracteres, avec remplacement d'une fin de ligne -- par un espace procedure Lire (C : out Character) is begin if End_Of_Line then Skip_Line; C := ' '; else Get (C); end if; end Lire; -- Largeur supposee de l'ecran Largeur : constant Positive := 80; -- Taille max du code Morse d'un caractere, plus un espace Taille_Max : constant Positive := 6 + 1; -- Procedure qui passe eventuellement a la ligne -- Pos est la positition d'ecriture sur la ligne courante procedure A_La_Ligne (Pos : in out Natural) is begin if Pos + Taille_Max > Largeur then New_Line; Pos := 0; end if; end A_La_Ligne; -- Procedure qui affiche S et gere la position d'affichage Pos procedure Afficher (Pos : in out Natural; S : in String) is begin Put (S); Pos := Pos + S'Length; end Afficher; -- Procedure qui affiche le code Morse de C -- et gere la position d'affichage Pos procedure Afficher_Code (Pos : in out Natural; C : in Character) is begin case C is when 'A' => Afficher (Pos, ".-"); when 'B' => Afficher (Pos, "-..."); when 'C' => Afficher (Pos, "-.-."); when 'D' => Afficher (Pos, "-.."); when 'E' => Afficher (Pos, "."); when 'F' => Afficher (Pos, "..-."); when 'G' => Afficher (Pos, "--."); when 'H' => Afficher (Pos, "...."); when 'I' => Afficher (Pos, ".."); when 'J' => Afficher (Pos, ".---"); when 'K' => Afficher (Pos, "-.-"); when 'L' => Afficher (Pos, ".-.."); when 'M' => Afficher (Pos, "--"); when 'N' => Afficher (Pos, "-."); when 'O' => Afficher (Pos, "---"); when 'P' => Afficher (Pos, ".--."); when 'Q' => Afficher (Pos, "--.-"); when 'R' => Afficher (Pos, ".-."); when 'S' => Afficher (Pos, "..."); when 'T' => Afficher (Pos, "-"); when 'U' => Afficher (Pos, "..-"); when 'V' => Afficher (Pos, "...-"); when 'W' => Afficher (Pos, ".--"); when 'X' => Afficher (Pos, "-..-"); when 'Y' => Afficher (Pos, "-.--"); when 'Z' => Afficher (Pos, "--.."); when '1' => Afficher (Pos, ".----"); when '2' => Afficher (Pos, "..---"); when '3' => Afficher (Pos, "...--"); when '4' => Afficher (Pos, "....-"); when '5' => Afficher (Pos, "....."); when '6' => Afficher (Pos, "-...."); when '7' => Afficher (Pos, "--..."); when '8' => Afficher (Pos, "---.."); when '9' => Afficher (Pos, "----."); when '0' => Afficher (Pos, "-----"); when '.' => Afficher (Pos, ".-.-.-"); when ',' => Afficher (Pos, "--..--"); when '?' => Afficher (Pos, "..--.."); when '/' => Afficher (Pos, "-..-."); when '+' => Afficher (Pos, ".-.-."); when ''' => Afficher (Pos, ".----."); when '=' => Afficher (Pos, "-....-"); when ' ' => Afficher (Pos, " "); -- 1 avant et 1 apres -> 3 when Dernier => Afficher (Pos, "...-.-"); when others => null; -- Cas impossible ! end case; end Afficher_Code; Lu : Character; Pos : Natural := 0; begin -- Coder loop Lire (Lu); A_La_Ligne (Pos); Afficher_Code (Pos, Lu); Afficher (Pos, " "); -- on met toujours un espace apres un code exit when Lu = Dernier; end loop; end Coder;

 
Liens connexes
· Plus à propos de Ada
· Nouvelles transmises par Romain_Le_Guen


L'article le plus lu à propos de Ada:
Compression Lempel Ziv en ADA


Article Rating
Average Score: 3
Votes: 2


Please take a second and vote for this article:

Excellent
Very Good
Good
Regular
Bad


Options

 Format imprimable Format imprimable


Associated Topics

Ada

PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.39 Seconds