From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7ef7640503406872,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!v18g2000yqe.googlegroups.com!not-for-mail From: juanmiuk Newsgroups: comp.lang.ada Subject: I need feedback Date: Tue, 14 Jun 2011 14:12:38 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 188.221.149.67 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1308085958 22538 127.0.0.1 (14 Jun 2011 21:12:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 14 Jun 2011 21:12:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v18g2000yqe.googlegroups.com; posting-host=188.221.149.67; posting-account=l6y7nQoAAABlM0ixwraR8Luww92dg7v2 User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HNKRUAELSC X-HTTP-UserAgent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91 Safari/534.30,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:19829 Date: 2011-06-14T14:12:38-07:00 List-Id: My name is Juan Miguel and I have ADHD. Since I have long wanted to learn Ada but I could not learn, because the medication was not correct and I could not concentrate properly. I returned to writing simple programs to get base. All I want is to tell me how I am doing. Thanks in advance. with Ada.Text_IO; with Ada.Numerics.Discrete_Random; with Ada.Strings.Fixed; use Ada; use Ada.Strings.Fixed; procedure ordenar_3_numeros_better is type UnoDiez is range 1 .. 10; package Ruleta10 is new Ada.Numerics.Discrete_Random(UnoDiez); Gen10: Ruleta10.Generator; begin Ruleta10.Reset(Gen10); for I in 1 .. 10 loop Proceso_Principal: declare A : UnoDiez := Ruleta10.Random(Gen10); B : UnoDiez := Ruleta10.Random(Gen10); C : UnoDiez := Ruleta10.Random(Gen10); First : UnoDiez; Secon : UnoDiez; Third : UnoDiez; begin Formateo_Salida_1: declare Separador1 : String := (UnoDiez'Width - UnoDiez'Image(A)'Length) * ' '; Separador2 : String := (UnoDiez'Width - UnoDiez'Image(B)'Length) * ' '; Separador3 : String := (UnoDiez'Width - UnoDiez'Image(C)'Length) * ' '; begin Text_IO.Put ( Separador1 & UnoDiez'Image(A) & "," & Separador2 & UnoDiez'Image(B) & "," & Separador3 & UnoDiez'Image(C) & " --" ); end Formateo_Salida_1; if (A >= B) then if (A >= C) then First := A; if (B >= C) then -- First := A; Secon := B; Third := C; else -- First := A; Secon := C; Third := B; end if; else -- C > A >= B First := C; Secon := A; Third := B; end if; elsif (B >= A) then if (B >= C) then First := B; if (A >= C) then -- First := B; Secon := A; Third := C; else -- First := B; Secon := C; Third := A; end if; else -- C > B >= A First := C; Secon := B; Third := A; end if; end if; Formateo_Salida_2: declare Separador1 : String := (UnoDiez'Width - UnoDiez'Image(First)'Length) * ' '; Separador2 : String := (UnoDiez'Width - UnoDiez'Image(Secon)'Length) * ' '; Separador3 : String := (UnoDiez'Width - UnoDiez'Image(Third)'Length) * ' '; begin Text_IO.Put ( Separador1 & UnoDiez'Image(First) & "," & Separador2 & UnoDiez'Image(Secon) & "," & Separador3 & UnoDiez'Image(Third) ); Text_IO.New_Line; end Formateo_Salida_2; end Proceso_Principal; end loop; end ordenar_3_numeros_better;