Oppure

Loading
15/10/12 15:04
program estrazione_lotto;
 
uses crt;
type
   tabella = array[1..11,1..5] of integer;
   nomi = array[1..11] of string[12];
   super = array[1..6] of integer;
   righe = array[1..6] of integer;
const
   nomi_ruote : nomi = ('Nazionale', 'Bari','Cagliari',
   'Firenze','Genova','Milano','Napoli','Palermo','Roma','Torino','Venezia');
   righe_super : righe = (2,6,7,8,9,11);
var
   tab:tabella;
   numa,numb,numc,ruota,band:integer;
   inizio:string;
   tipo:char;
   sup:super;
procedure estr;
                var
                k,i,aux,x,pos:integer;
        begin
            sup[1]:=tab[2,1];
            x:=0;
            for k:=2 to 6 do
              begin
                    i:=righe_super[k];
                    pos:=1;
                    aux:=tab[i,1+x];
                    while (sup[pos]<>aux) and (pos<=k) do
                    begin
                     pos:=pos+1;
                    end;
                    if pos>k then
                     sup[k]:=tab[i,1+x];
                     write(sup[k]:4);
                     x:=0;
                    else
                    x:=x+1;
                    k:=k-1;
                   end;
             end;
        end;
procedure estrazione;
var
   a,b,pos,x,i,j: integer;
begin
 
randomize;
     for a:=1  to 11 do
     begin
       tab[a,1]:=random(90)+1;
 
          for b:=2 to 5 do
           begin
             repeat
             x:=random(90)+1;
             pos:=1;
             while (tab[a,pos]<>x) and (pos < b) do
             pos:=pos+1;
             until (pos>=b);
             tab[a,b]:=x
          end;
    end;
end;
 
procedure scrivi;
var
   a,b,num,col:integer;
   numa:string;
    begin
     centra('Estrazione del lotto',1);
     num:=2;
     col:=5;
    (* gotoxy(1,5);*)
 
          for a:=1 to 11 do
               begin
                  gotoxy(num,col);
                  write (nomi_ruote[a]:9);
                  Write('       ');
                  for b:=1 to 5 do
 
                        begin
 
                         write (tab[a,b]:5);
                        end;
 
                col:=col+1;
               end;
 
    end;

 begin(* repeat*)
 clrscr;

        estrazione;
        centra('Estrazione del lotto',1);
        writeln;estr; writeln;scrivi;
      (* gioca;
        delay(4000);
        textcolor(7);
        clrscr;
        scrivi;
        cerca;
        writeln;
        Writeln;
        tuoi_dati;
        textcolor(7);
        Writeln;
        Write(' Vuoi continuare?(si\no) ');
        readln(scelta);
        until scelta='no'*)
        readln;
        readln;
end.
Ultima modifica effettuata da 15/10/12 15:06
15/10/12 15:45
Goblin
Postato originariamente da stichtom:

program estrazione_lotto;
 
procedure estr;
                var
                k,i,aux,x,pos:integer;
        begin
            sup[1]:=tab[2,1];
            x:=0;
            for k:=2 to 6 do
              begin
                    i:=righe_super[k];
                    pos:=1;
                    aux:=tab[i,1+x];
                    while (sup[pos]<>aux) and (pos<=k) do
                    begin
                     pos:=pos+1;
                    end;
                    if pos>k then
                     sup[k]:=tab[i,1+x];
                     write(sup[k]:4);
                     x:=0;
                    else
                    x:=x+1;
                    k:=k-1;
                   end;
             end;
        end;


Ci provo :)

procedure estr;
                var
                k,i,aux,x,pos:integer;
        begin
            sup[1]:=tab[2,1];
            x:=0;
            for k:=2 to 6 do
              begin
                    i:=righe_super[k];
                    pos:=1;
                    aux:=tab[i,1+x];
                    while (sup[pos]<>aux) and (pos<=k) do
                    begin
                     pos:=pos+1;
                    end;
                    if pos>k then
------------->Begin
                     sup[k]:=tab[i,1+x];
                     write(sup[k]:4);
                     x:=0;
------------->end
                    else
------------->Begin
                    x:=x+1;
                    k:=k-1;
                   end;
             end;
        end;
Ibis redibis non morieris in bello
15/10/12 16:15
Urca mi ero dimenticato di aggiungere i begin\end qui sul forum ma comunque li avevo già messi nel programma.

L'errore riguarda la riga in cui c'è "k:=k+1;" in quanto "Illegal assignment to for-loop variable k"
15/10/12 17:05
Ultimo
Postato originariamente da stichtom:

Urca mi ero dimenticato di aggiungere i begin\end qui sul forum ma comunque li avevo già messi nel programma.

L'errore riguarda la riga in cui c'è "k:=k+1;" in quanto "Illegal assignment to for-loop variable k"


k:=k-1 , no no, funziona lo provata ,

guarda ti ho modificato il vecchio codice, e funziona



    program estrazione_lotto;
     
    uses crt;
    type
       tabella = array[1..11,1..5] of integer;
       nomi = array[1..11] of string[12];
       super = array[1..6] of integer;
       righe = array[1..6] of integer;

    const
       nomi_ruote : nomi = ('Nazionale', 'Bari','Cagliari',
       'Firenze','Genova','Milano','Napoli','Palermo','Roma','Torino','Venezia');
        righe_super : righe = (2,6,7,8,9,11);


    var
       tab:tabella;
       numa,numb,numc,ruota,band:integer;
       inizio:string;
       tipo:char;
       sup:super;
     
    procedure centra(scritta:string;y:integer);
       var
       x:integer;
    begin
         x:=((80-(length(scritta)))div 2);
         gotoxy(x,y);
         write(scritta);
    end;
     
    procedure estrazione;
    var
       a,b,pos,x: integer;
    begin
     
    randomize;
         for a:=1  to 11 do
         begin
           tab[a,1]:=random(90)+1;
     
              for b:=2 to 5 do
               begin
                 repeat
                 x:=random(90)+1;
                 pos:=1;
                 while (tab[a,pos]<>x) and (pos < b) do
                 pos:=pos+1;
                 until (pos>=b);
                 tab[a,b]:=x
              end;
        end;
    end;
     
      procedure estrSuperEnalotto;
         var
         k,i,aux,x,pos:integer;
         begin
          sup[1]:=tab[2,1];
          x:=0;
                for k:=2 to 6 do
                  begin
                        i:=righe_super[k];
                        pos:=1;
                        aux:=tab[i,1+x];
                        while (sup[pos]<>aux) and (pos<=k) do
                         pos:=pos+1;
                        if pos>k then
                         begin
                         sup[k]:=tab[i,1+x];
                         x:=0;
                         end;
                        if pos<=k then
                        begin
                        x:=x+1;
                        k:=k-1;
                        end;
                 end;
         end;

    procedure scrivi;
    var
       a,b,num,col:integer;

        begin
         centra('Estrazione del lotto',1);
         num:=2;
         col:=5;
        (* gotoxy(1,5);*)
     
              for a:=1 to 11 do
                   begin
                      gotoxy(num,col);
                      write (nomi_ruote[a]:9);
                      Write('       ');
                      for b:=1 to 5 do
     
                            begin
     
                             write (tab[a,b]:5);
                            end;
     
                    col:=col+1;
                   end;
          writeln;
          Writeln;
          Writeln(' Estrazione SuperEnalotto : ');
          writeln;
            for b:=1 to 6 do
             begin
             write(sup[b]:5);
             end;
          writeln;
          Writeln;
        end;
     
    procedure cerca;
     var a,b,cont,num:integer;
    begin
            gotoxy(2,20);
            Write('Cerca un Numero: ');
            readln(num);
            cont:=0;
            for a:=1 to 11 do
              for b:=1 to 5 do
               if num=tab[a,b]  then
                begin
                 Writeln(' Il numero si trova nella ruota numero ',a,' in posizione ', b,'');
                 cont:=1;
                end;
     
               If cont=0 then writeln(' Il numero non e'' presente in nessuna ruota');
     
     
    end;
     
    procedure gioca;
     
       var
       b,a:integer;
     
    begin
           writeln;
           Writeln;
           Writeln;
           write(' Vuole fare una puntata(si\no)? ');
           readln(inizio);
            if
               inizio=('si') then
               begin
                write(' Vuole giocare un ambo o un terno? ');
                readln(tipo);
     
                    case tipo of
                            'a' : begin
                                    Write(' Inserisci il primo numero che vuoi puntare: ');
                                    readln(numa);
                                    Write(' Inserisci il secondo numero che vuoi puntare: ');
                                    readln(numb);
                                    gotoxy(2,10);
                                    writeln('1 = Nazionale');
                                    Writeln(' 2 = Bari');
                                    Writeln(' 3 = Caglairi');
                                    Writeln(' 4 = Firenze');
                                    Writeln(' 5 = Genova');
                                    Writeln(' 6 = Milano');
                                    Writeln(' 7 = Napoli');
                                    Writeln(' 8 = Palermo');
                                    Writeln(' 9 = Roma');
                                    writeln(' 10 = Torino');
                                    Writeln(' 11 = Venezia');
                                    gotoxy(1,8);
                                    Write(' Inserisci il nome (numero da 1 a 11) della ruota in cui vuoi giocare: ');
                                    readln(ruota);
                                    band:=0;
     
                                    a:=ruota;
     
                                            for b:=1 to 5 do
                                                begin
                                                    if (numa=tab[a,b]) then  band:=band+1;
                                                    if (numb=tab[a,b]) then  band:=band+1;
                                                end;
                                                    if band>=2 then
                                                     begin
                                                       if numa<>numb then
     
                                                            begin
                                                              clrscr;
                                                              textcolor(green);
                                                              centra(' Congratulazioni, hai vinto!',11);
                                                              centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                              gotoxy(2,19);
                                                            end;
                                                     end
                                                       else  if numa=numb then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare due numeri uguali!',11);
                                                             centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;
     
     
     
                                    If band<2 then
                                     begin
                                      if numa<>numb then
                                       begin
                                            clrscr;
                                            Textcolor(red);
                                            centra('Hai perso!',11);
                                            centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                            gotoxy(2,19);
                                      end;
                                     end
                                     else  if numa=numb then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare due numeri uguali!',11);
                                                             centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;
     
                             end;
                             't': begin
                                    Write(' Inserisci il primo numero che vuoi puntare: ');
                                    readln(numa);
                                    Write(' Inserisci il secondo numero che vuoi puntare: ');
                                    readln(numb);
                                    Write(' Inserisci il terzo numero che vuoi puntare: ');
                                    readln(numc);
                                    gotoxy(2,10);
                                    writeln('1 = Nazionale');
                                    Writeln(' 2 = Bari');
                                    Writeln(' 3 = Caglairi');
                                    Writeln(' 4 = Firenze');
                                    Writeln(' 5 = Genova');
                                    Writeln(' 6 = Milano');
                                    Writeln(' 7 = Napoli');
                                    Writeln(' 8 = Palermo');
                                    Writeln(' 9 = Roma');
                                    writeln(' 10 = Torino');
                                    Writeln(' 11 = Venezia');
                                    gotoxy(1,8);
                                    Write(' Inserisci il nome(numero da 1 a 11) della ruota in cui vuoi giocare: ');
                                    readln(ruota);
                                    band:=0;
     
                                    a:=ruota;
     
                                            for b:=1 to 5 do
                                                begin
                                                    if (numa=tab[a,b]) then  band:=band+1;
                                                    if (numb=tab[a,b]) then  band:=band+1;
                                                    if (numc=tab[a,b]) then  band:=band+1;
                                                end;
                                                    if band=3 then
                                                     begin
                                                       if (numa<>numb) and (numa<>numc) then
     
                                                            begin
                                                              clrscr;
                                                              textcolor(green);
                                                              centra(' Congratulazioni, hai vinto!',11);
                                                              centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                              gotoxy(2,19);
                                                            end;
                                                     end
                                                       else  if (numa=numb) or (numc=numa) or (numb=numc) then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare numeri uguali!',11);
                                                             centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;
     
     
     
                                    If band<3 then
                                     begin
                                      if (numa<>numb) and (numb<>numc) then
                                       begin
                                            clrscr;
                                            Textcolor(red);
                                            centra('Hai perso!',11);
                                            centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                            gotoxy(2,19);
                                      end;
                                     end
                                     else  if (numa=numb) or (numb=numc) or (numa=numc) then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare numeri uguali!',11);
                                                             centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;
     
                             end;
     
            end;
            end;
             if inizio=('no') then  write(' Attenda, caricamento estrazione in corso....');
     
            end;
     
    procedure tuoi_dati;
     
              begin
                gotoxy(2,21);
                 if inizio <> ('no') then
                  if tipo = ('a') then
                   begin
                    writeln('I numeri che avevi puntato sono: ',numa,' e ',numb);
                    Writeln(' Hai puntato nella ruota numero ',ruota,'  ', nomi_ruote[ruota]);
                   end
                  else if tipo = ('t') then
                   begin
                    writeln('I numeri che avevi puntato sono: ',numa,', ',numb,' e ',numc);
                    Writeln(' Hai puntato nella ruota numero ',ruota,'  ', nomi_ruote[ruota]);
                   end;
     
          end;
     
     
     
     
      var scelta:string;
     begin repeat
     clrscr;
     
            estrazione;
            estrSuperEnalotto;
            centra('Estrazione del lotto',1);
            gioca;
            delay(4000);
            textcolor(7);
            clrscr;
            scrivi;
            (*cerca;*)
            writeln;
            Writeln;
            tuoi_dati;
            textcolor(7);
            Writeln;
            Writeln;
            Writeln;
            Writeln;
            Write(' Vuoi continuare?(si\no) ');
            readln(scelta);
            until scelta='no'
     
    end.

Ultima modifica effettuata da Ultimo 15/10/12 18:00
If ok Then GOTO Avanza else GOTO Inizia

15/10/12 20:02
Goblin
PARERE PERSONALE
357 linee di codice e ancora manca il check della quaterna e della cinquina, oltre al controllo dei punti del superenalotto, mi sembrano troppe, mantenere un simile sorgente diventa complicato, poi ....
Ibis redibis non morieris in bello
15/10/12 20:47
@ Ultimo: Che compilatore usi? Perchè a me continua a darmi l'errore di prima con freepascal

@Goblin: Hai perfettamente ragione, ormai lo finisco e poi provo ad ottimizzarlo ;)
16/10/12 10:55
Ultimo

Si Goblin si può ancora migliorare, manca anche la possibiltà di puntare su più ruote e su tutte le ruote,
puntare al superenalotto, simulare le giocate in denaro con un montepremi che aumenta o diminuisce
in base alle vincite, ci metterei anche le statistiche :heehee:

Ho compilato il sorgente con Dev-Pascal :yup:
If ok Then GOTO Avanza else GOTO Inizia

23/10/12 20:02
stichtom
Ho finalmente finito tutto il programma e penso che sia venuto abbastanza bene:
avrei solo una domanda, secondo voi si possono fare delle procedure\funzioni con parametri per rendere il tutto più efficiente?

program estrazione_lotto;

    uses crt;
    type
       tabella = array[1..11,1..5] of integer;
       nomi = array[1..11] of string[12];
       super = array[1..6] of integer;
       righe = array[1..6] of integer;

    const
       nomi_ruote : nomi = ('Nazionale', 'Bari','Cagliari',
       'Firenze','Genova','Milano','Napoli','Palermo','Roma','Torino','Venezia');
        righe_super : righe = (2,6,7,8,9,11);


    var
       tab:tabella;
       numa,numb,numc,numd,nume,numf,ruota,band:integer;
       tipo:char;
       inizio:string;
       sup:super;

    procedure centra(scritta:string;y:integer);
       var
       x:integer;
    begin
         x:=((80-(length(scritta)))div 2);
         gotoxy(x,y);
         write(scritta);
    end;

    procedure estrazione;
    var
       a,b,pos,x: integer;
    begin

    randomize;
         for a:=1  to 11 do
         begin
           tab[a,1]:=random(90)+1;

              for b:=2 to 5 do
               begin
                 repeat
                 x:=random(90)+1;
                 pos:=1;
                 while (tab[a,pos]<>x) and (pos < b) do
                 pos:=pos+1;
                 until (pos>=b);
                 tab[a,b]:=x
              end;
        end;
    end;

     procedure estrSuperEnalotto;
         var
         k,i,aux,x,pos:integer;
         begin
          sup[1]:=tab[2,1];
          x:=0;
                for k:=2 to 6 do
                  begin
                        i:=righe_super[k];
                        pos:=1;
                        aux:=tab[i,1+x];
                        while (sup[pos]<>aux) and (pos<=k) do
                         pos:=pos+1;
                        if pos>k then
                         begin
                         sup[k]:=tab[i,1+x];
                         x:=0;
                         end;
                        if pos<=k then
                        begin
                        x:=x+1;
                        k:=k-1;
                        end;
                 end;
         end;

    procedure scrivi;
    var
       a,b,num,col:integer;

        begin
         centra('Estrazione del lotto',1);
         num:=2;
         col:=5;
                for a:=1 to 11 do
                   begin
                      gotoxy(num,col);
                      write (nomi_ruote[a]:9);
                      Write('       ');
                      for b:=1 to 5 do

                            begin

                             write (tab[a,b]:5);
                            end;

                    col:=col+1;
                   end;
          writeln;


          writeln;
          Writeln;
        end;

    procedure stampa_superenalotto;
        var
        b:integer;
    begin
         Writeln(' Estrazione SuperEnalotto : ');
          writeln;
            for b:=1 to 6 do
             begin
             write(sup[b]:5);
             end;
   end;
    procedure cerca;
     var a,b,cont,num:integer;
    begin
            gotoxy(2,20);
            Write('Cerca un Numero: ');
            readln(num);
            cont:=0;
            for a:=1 to 11 do
              for b:=1 to 5 do
               if num=tab[a,b]  then
                begin
                 Writeln(' Il numero si trova nella ruota numero ',a,' in posizione ', b,'');
                 cont:=1;
                end;

               If cont=0 then writeln(' Il numero non e'' presente in nessuna ruota');


    end;

    procedure elenco_citta;
     begin
          gotoxy(2,10);
          writeln('1 = Nazionale');
          Writeln(' 2 = Bari');
          Writeln(' 3 = Caglairi');
          Writeln(' 4 = Firenze');
          Writeln(' 5 = Genova');
          Writeln(' 6 = Milano');
          Writeln(' 7 = Napoli');
          Writeln(' 8 = Palermo');
          Writeln(' 9 = Roma');
          writeln(' 10 = Torino');
          Writeln(' 11 = Venezia');
          gotoxy(1,8);
     end;


    procedure gioca;

       var
       b,a,c:integer;

    begin
           writeln;
           Writeln;
           Writeln;
           write(' Vuole giocare al lotto o al superenalotto? ');
           readln(inizio);
             if inizio=('lotto') then
              begin
                clrscr;
                writeln;
                centra('Estrazione del lotto',1);
                gotoxy(2,4);
                write('Vuole giocare un numero singolo, un ambo o un terno? ');
                readln(tipo);

                    case tipo of
                             's' :  begin
                                    Write(' Inserisci il numero che vuoi puntare: ');
                                    readln(numa);
                                    elenco_citta;
                                    Write(' Inserisci il nome (numero da 1 a 11) della ruota in cui vuoi giocare: ');
                                    readln(ruota);
                                    band:=0;

                                    a:=ruota;

                                            for b:=1 to 5 do
                                                begin
                                                    if (numa=tab[a,b]) then  band:=band+1;
                                                end;
                                                    if band>=1 then
                                                     begin
                                                       if numa<>numb then

                                                            begin
                                                              clrscr;
                                                              textcolor(green);
                                                              centra(' Congratulazioni, hai vinto!',11);
                                            centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                              gotoxy(2,19);
                                                            end;
                                                     end
                                                       else  if numa=numb then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare due numeri uguali!',11);
                                              centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;



                                    If band<1 then
                                     begin
                                      if numa<>numb then
                                       begin
                                            clrscr;
                                            Textcolor(red);
                                            centra('Hai perso!',11);
                                            centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                            gotoxy(2,19);
                                      end;
                                     end
                                     else  if numa=numb then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare due numeri uguali!',11);
                               centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;

                             end;

                            'a' :  begin
                                    Write(' Inserisci il primo numero che vuoi puntare: ');
                                    readln(numa);
                                    Write(' Inserisci il secondo numero che vuoi puntare: ');
                                    elenco_citta;
                                    Write(' Inserisci il nome (numero da 1 a 11) della ruota in cui vuoi giocare: ');
                                    readln(ruota);
                                    band:=0;

                                    a:=ruota;

                                            for b:=1 to 5 do
                                                begin
                                                    if (numa=tab[a,b]) then  band:=band+1;
                                                    if (numb=tab[a,b]) then  band:=band+1;
                                                end;
                                                    if band>=2 then
                                                     begin
                                                       if numa<>numb then

                                                            begin
                                                              clrscr;
                                                              textcolor(green);
                                                              centra(' Congratulazioni, hai vinto!',11);
                                            centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                              gotoxy(2,19);
                                                            end;
                                                     end
                                                       else  if numa=numb then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare due numeri uguali!',11);
                                              centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;



                                    If band<2 then
                                     begin
                                      if numa<>numb then
                                       begin
                                            clrscr;
                                            Textcolor(red);
                                            centra('Hai perso!',11);
                                            centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                            gotoxy(2,19);
                                      end;
                                     end
                                     else  if numa=numb then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare due numeri uguali!',11);
                               centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;

                             end;
                             't': begin
                                    Write(' Inserisci il primo numero che vuoi puntare: ');
                                    readln(numa);
                                    Write(' Inserisci il secondo numero che vuoi puntare: ');
                                    readln(numb);
                                    Write(' Inserisci il terzo numero che vuoi puntare: ');
                                    readln(numc);
                                    elenco_citta;
                                    Write(' Inserisci il nome(numero da 1 a 11) della ruota in cui vuoi giocare: ');
                                    readln(ruota);
                                    band:=0;

                                    a:=ruota;

                                            for b:=1 to 5 do
                                                begin
                                                    if (numa=tab[a,b]) then  band:=band+1;
                                                    if (numb=tab[a,b]) then  band:=band+1;
                                                    if (numc=tab[a,b]) then  band:=band+1;
                                                end;
                                                    if band=3 then
                                                     begin
                                                       if (numa<>numb) and (numa<>numc) then

                                                            begin
                                                              clrscr;
                                                              textcolor(green);
                                                              centra(' Congratulazioni, hai vinto!',11);
   centra('A breve ti verra'' visualizzat  l''estrazione completa',13);
                                                              gotoxy(2,19);
                                                            end;
                                                     end
                                                       else  if (numa=numb) or (numc=numa) or (numb=numc) then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare numeri uguali!',11);
 centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;



                                    If band<3 then
                                     begin
                                      if (numa<>numb) and (numb<>numc) then
                                       begin
                                            clrscr;
                                            Textcolor(red);
                                            centra('Hai perso!',11);
                                            centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                            gotoxy(2,19);
                                      end;
                                     end
                                     else  if (numa=numb) or (numb=numc) or (numa=numc) then
                                                            begin
                                                             clrscr;
                                                             Textcolor(red);
                                                             centra('Non puoi puntare numeri uguali!',11);
 centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                                                             gotoxy(2,19);
                                                             end;
                                    end;
             end;
       end
   else if inizio = ('superenalotto') then
      begin
        clrscr;
        band:=0;
        centra('Gioco del superenalotto',1);
        gotoxy(2,4);
         Writeln('INFO: Si vince solamente fancedo sei');
         writeln;
         Write(' Inserisci i sei numeri che vuoi giocare seprati da uno spazio: ');
         Read(numa,numb,numc,numd,nume,numf);
          for c:=1 to 6 do
           begin
            if (numa=sup[c]) then band:=band+1;
            if (numb=sup[c]) then band:=band+1;
            if (numc=sup[c]) then band:=band+1;
            if (numd=sup[c]) then band:=band+1;
            if (nume=sup[c]) then band:=band+1;
            if (numf=sup[c]) then band:=band+1;
           end;

             if band<6 then
                begin
                      clrscr;
                      Textcolor(red);
                      centra('Hai perso!',11);
                      centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                      gotoxy(2,19);
               end;
              if band>=6 then
                 begin
                    clrscr;
                      Textcolor(green);
                      centra('Hai vinto!',11);
                      centra('A breve ti verra'' visualizzata l''estrazione completa',13);
                      gotoxy(2,19);
                  end;
    end
  else
    Write(' Errore, devi scrivere lotto o superenalotto');

end;

    procedure tuoi_dati;

          begin
            gotoxy(2,18);
               if inizio = 'lotto' then  begin
                scrivi;
                  if tipo = ('a') then
                   begin
                    writeln(' I numeri che avevi puntato sono: ',numa,' e ',numb);
                    Writeln(' Hai puntato nella ruota di ', nomi_ruote[ruota]);
                   end
                  else if tipo = ('t') then
                   begin
                    writeln(' I numeri che avevi puntato sono: ',numa,', ',numb,' e ',numc);
                    Writeln(' Hai puntato nella ruota di ', nomi_ruote[ruota]);
                   end
                  else if tipo = ('s') then
                   begin
                    writeln(' Il numero che hai puntato e'': ',numa);
                    Writeln(' Hai puntato nella ruota di ', nomi_ruote[ruota]);
                   end;
                  end
               else if inizio = 'superenalotto' then
                    begin
                      scrivi;
                      gotoxy(2,18);
                      stampa_superenalotto;
                      Writeln;
                      Writeln;
                      Write(' I numeri che hai puntato sono: ',numa,' ', numb,' ',numc,' ',numd,' ',nume,' ', numf);
                      Writeln;
                      Write(' Hai indovinato ', band,' numeri');
                      readln;
                    end;
          end;



      var scelta:string;
     begin
      repeat
       clrscr;
            estrazione;
            estrSuperEnalotto;
            centra('Estrazione del lotto',1);
            gioca;
            delay(5000);
            textcolor(7);
            clrscr;
            writeln;
            Writeln;
            tuoi_dati;
            textcolor(7);
            Writeln;
            Writeln;
            Writeln;
            Writeln;
            Write(' Vuoi continuare?(si\no) ');
            readln(scelta);
            until scelta='no'

    end.
aaa