-- programma : MasterMind -- autori : Naini G. e Petrini G. -- versione : 1.039 -- data : 28.06.2001 -- ambinete : Windows 95/98 con Ansi.sys -- compilatore : Gnatmake con pcGRASP -- note : IN AMBIENTE WINDOWS ANSI.SYS DEVE ESSERE CARICATO!!! with Ada.Text_Io, Ada.Integer_Text_Io, Ada.Numerics.Discrete_Random; use Ada.Text_Io, Ada.Integer_Text_Io; procedure Mm is N_Livello : natural := 5; N_Colori : natural := 7; N_Tentativi : natural := 10; Ch : Character; -- va bene per tante cose Eccezione_fuga : exception; procedure Get_livello is n : integer; begin put(Ascii.esc); put("[2J"); loop new_line(5); set_col(10); Put("Numero di colori [2..7] (7): "); Get(n); case n is when 1 => N_Colori := N; when 2 => N_Colori := N; when 3 => N_Colori := N; when 4 => N_Colori := N; when 5 => N_Colori := N; when 6 => N_Colori := N; when 7 => N_Colori := N; when others => N_Colori := 7; set_col(10); Put("N colori settato a 7"); end case; set_col(10); Put("Numero di caselle [2..5] (5): "); Get(n); case n is when 2 => N_Livello := n; when 3 => N_Livello := n; when 4 => N_Livello := n; when 5 => N_Livello := n; when others => N_Livello := 5; set_col(10); Put("N colori settato a 5"); end case; set_col(10); Put("Numero di tentativi [1..10] (10): "); Get(n); case n is when 1 => N_Tentativi := n; when 2 => N_Tentativi := n; when 3 => N_Tentativi := n; when 4 => N_Tentativi := n; when 5 => N_Tentativi := n; when 6 => N_Tentativi := n; when 7 => N_Tentativi := n; when 8 => N_Tentativi := n; when 9 => N_Tentativi := n; when 10 => N_Tentativi := n; when others => N_Tentativi := 10; set_col(10); Put("N colori settato a 10"); end case; put(Ascii.esc); put("[2J"); new_line(5); set_col(10); Put("I settaggi sono: "); put(Ascii.esc); put("[1;37;40m"); new_line(2); set_col(13); put("Colori: "); put(N_Colori, width => 0); new_line; set_col(13); put("Caselle: "); put(N_Livello, width => 0); new_line; set_col(13); put("Tentativi: "); put(N_Tentativi, width => 0); new_line; put(Ascii.esc); put("[0;37;40m"); set_col(10); Put("Vuoi giocare con questi parametri? "); Get(ch); case Ch is when 'S'|'s' => exit; -- ok..esce when 'N'|'n' => set_col(13);put("Bene...si ricomincia"); delay (0.7); put(Ascii.esc); put("[2J"); when 'Q'|'q' => raise Eccezione_fuga; when others => put("-- Tasto errato : considero come SI -- ");delay (0.7); exit; end case; end loop; end Get_livello; ------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------- procedure Gioca is type T_Colore is (Rosso, Verde, Giallo, Azzurro, Magenta, Ciano, Bianco); subtype Colore is T_Colore range T_Colore'Val(0)..T_Colore'Val(N_colori-1); package Random_C is new Ada.Numerics.Discrete_Random(Colore); use Random_C; -- tutta roba per i random Gen : Random_C.Generator; type Vettore_C is array (1..N_Livello) of Colore; type Matrice_C is array (1..N_Tentativi,1..N_Livello) of Colore; type Vettore_N is array (1..N_Tentativi) of Natural; Soluzione : Vettore_C; -- Colori da indovinare Campo : Matrice_C; -- Righe e colonne dei tentativi Tentativo : Natural :=0; -- Riga del tentativo S_r,S_g,S_b,S_v,S_m,S_c,S_a : natural := 0; -- Numero di corrispondenze del colore nella soluzione O_r,O_g,O_b,O_v,O_m,O_c,O_a : natural := 0; -- Numero di corrispondenze originali del colore nella soluzione T_r,T_g,T_b,T_v,T_m,T_c,T_a : natural := 0; -- Numero di corrispondenze del colore nel tentativo Cgpg : Vettore_N := (others => 0); -- Colore giusto al posto giusto Cgps : Vettore_N := (others => 0); -- Colore giusto al posto sbagliato Vinto, Perso : Boolean := False; Errore_Colore : boolean :=false; -------------------------------------------------------------------------------------------------------------- function Conv(Clr : in Colore) return Character is -- converte Colore -> carattere begin case Clr is when Rosso => return 'R'; when Verde => return 'V'; when Giallo => return 'G'; when Azzurro => return 'A'; when Magenta=> return 'M'; when Ciano => return 'C'; when Bianco => return 'B'; end case; end Conv; -------------------------------------------------------------------- function G_CC (ch : in character) return string is -- associa carattere -> codice colore begin case ch is when 'R' => return "[1;31;40m"; -- rosso when 'V' => return "[1;32;40m"; -- verde when 'G' => return "[1;33;40m"; -- giallo when 'A' => return "[1;34;40m"; -- azzurro when 'M' => return "[1;35;40m"; -- magenta when 'C' => return "[1;36;40m"; -- ciano when 'B' => return "[1;37;40m"; -- bianco when others => return ""; end case; end G_CC; -------------------------------------------------------------------------------------------------------------- procedure Iniziali_Colori(N_Colori : in natural) is -- serie delle iniziali dei colori disponibili begin for i in 0..N_Colori-1 loop put(Ascii.Esc); put(G_cc(Conv(T_Colore'val(i)))); -- codice put(conv(T_Colore'val(i)) ); put(Ascii.esc); put("[0;37;40m"); -- reset colori put(" "); end loop; end Iniziali_Colori; -------------------------------------------------------------------------------------------------------------- procedure Visualizza (vinto, perso: in boolean; N_Livello : in natural; N_Tentativi : in natural; Tentativo : in natural; Soluzione : in Vettore_C; Campo : in Matrice_C) is -- mette a schermo la partita begin put(Ascii.esc); put("[2J"); -- clear put(Ascii.esc); put("[0;37;40m"); -- rese colori if vinto or perso then -- se finisce -- ************************** put("+---"); for i in 1..N_Livello-2 loop put("----"); end loop; put("----+"); new_line; Put("| "); for i in 1..N_Livello loop put(Ascii.esc); put(G_cc(Conv(Soluzione(i)))); -- codice colore Put(Conv(Soluzione(i))); -- carattere put(Ascii.esc); put("[0;37;40m"); -- rese colori Put(" | "); end loop; New_Line; put("+---"); for i in 1..N_Livello-2 loop put("----"); end loop; put("----+"); new_line; -- ************************** else -- se non finisce put("+---"); for i in 1..N_Livello-2 loop put("----"); end loop; put("----+"); new_line; for i in 1..N_Livello loop put("| ? "); end loop; put("|"); set_col(25); put("Tentativi rimanenti: "); put(N_Tentativi - tentativo, width => 0); new_line; put("+---"); for i in 1..N_Livello-2 loop put("----"); end loop; put("----+"); set_col(25); Iniziali_Colori(N_Colori); new_line; end if; for I in reverse 1..Tentativo loop put("+---"); for J in 1..N_Livello-2 loop put("----"); end loop; put("----+"); new_line; for J in 1..N_Livello loop put("| "); put(Ascii.Esc); put(G_cc(Conv(Campo(I,J)))); -- codice put(Conv(Campo(I,J))); -- carattere put(Ascii.esc); put("[0;37;40m"); -- reset colori put(" "); end loop; put("|"); for s in 1..24-(N_livello*4+1) loop -- questo for sostituisce un set_col che per qualche motivo non funziona put(" "); end loop; Put(Cgpg(I), Width => 0); Put(" - "); Put(Cgps(I), Width => 0); new_line; end loop; if Tentativo /= 0 then put("+---"); for J in 1..N_Livello-2 loop put("----"); end loop; put("----+"); end if; New_Line; -- NEW_LINE end Visualizza; -------------------------------------------------------------------------------------------------------------- procedure Get_Colori(campo : in out matrice_C; Tentativo : in natural; T_r, T_v, T_g, T_a, T_m, T_c, T_b : in out natural; errore_colore: in out boolean) is -- salva i colori dati dal giocatore nel Campo begin loop errore_colore := false; -- reset di Errore_colore case N_Colori is when 7 => for I in 1..N_Livello loop put(" "); Get_Immediate(Ch); -- CONSTRAINT_ERROR evitato in "when others" Put(Ch); case Ch is when 'R'|'r' => Campo(Tentativo,I):= Rosso; T_r :=T_r + 1; when 'V'|'v' => Campo(Tentativo,I):= Verde; T_v :=T_v + 1; when 'G'|'g' => Campo(Tentativo,I):= Giallo; T_g :=T_g + 1; when 'A'|'a' => Campo(Tentativo,I):= Azzurro; T_a :=T_a + 1; when 'M'|'m' => Campo(Tentativo,I):= Magenta; T_m :=T_m + 1; when 'C'|'c' => Campo(Tentativo,I):= Ciano; T_c :=T_c + 1; when 'B'|'b' => Campo(Tentativo,I):= Bianco; T_b :=T_b + 1; when 'Q'|'q' => set_col(25); put("--> uscita <--"); raise Eccezione_fuga; when others => Errore_Colore := true; set_col(25); put("--> Colore non valido <--"); delay(0.7); new_line; exit; end case; Put(" "); end loop; when 6 => for I in 1..N_Livello loop put(" "); Get_Immediate(Ch); -- CONSTRAINT_ERROR evitato in "when others" Put(Ch); case Ch is when 'R'|'r' => Campo(Tentativo,I):= Rosso; T_r :=T_r + 1; when 'V'|'v' => Campo(Tentativo,I):= Verde; T_v :=T_v + 1; when 'G'|'g' => Campo(Tentativo,I):= Giallo; T_g :=T_g + 1; when 'A'|'a' => Campo(Tentativo,I):= Azzurro; T_a :=T_a + 1; when 'M'|'m' => Campo(Tentativo,I):= Magenta; T_m :=T_m + 1; when 'C'|'c' => Campo(Tentativo,I):= Ciano; T_c :=T_c + 1; when 'Q'|'q' => set_col(25); put("--> uscita <--"); raise Eccezione_fuga; when others => Errore_Colore := true; set_col(25); put("--> Colore non valido <--"); delay(0.7); new_line; exit; end case; Put(" "); end loop; when 5 => for I in 1..N_Livello loop put(" "); Get_Immediate(Ch); -- CONSTRAINT_ERROR evitato in "when others" Put(Ch); case Ch is when 'R'|'r' => Campo(Tentativo,I):= Rosso; T_r :=T_r + 1; when 'V'|'v' => Campo(Tentativo,I):= Verde; T_v :=T_v + 1; when 'G'|'g' => Campo(Tentativo,I):= Giallo; T_g :=T_g + 1; when 'A'|'a' => Campo(Tentativo,I):= Azzurro; T_a :=T_a + 1; when 'M'|'m' => Campo(Tentativo,I):= Magenta; T_m :=T_m + 1; when 'Q'|'q' => set_col(25); put("--> uscita <--"); raise Eccezione_fuga; when others => Errore_Colore := true; set_col(25); put("--> Colore non valido <--"); delay(0.7); new_line; exit; end case; Put(" "); end loop; when 4 => for I in 1..N_Livello loop put(" "); Get_Immediate(Ch); -- CONSTRAINT_ERROR evitato in "when others" Put(Ch); case Ch is when 'R'|'r' => Campo(Tentativo,I):= Rosso; T_r :=T_r + 1; when 'V'|'v' => Campo(Tentativo,I):= Verde; T_v :=T_v + 1; when 'G'|'g' => Campo(Tentativo,I):= Giallo; T_g :=T_g + 1; when 'A'|'a' => Campo(Tentativo,I):= Azzurro; T_a :=T_a + 1; when 'Q'|'q' => set_col(25); put("--> uscita <--"); raise Eccezione_fuga; when others => Errore_Colore := true; set_col(25); put("--> Colore non valido <--"); delay(0.7); new_line; exit; end case; Put(" "); end loop; when 3 => for I in 1..N_Livello loop put(" "); Get_Immediate(Ch); -- CONSTRAINT_ERROR evitato in "when others" Put(Ch); case Ch is when 'R'|'r' => Campo(Tentativo,I):= Rosso; T_r :=T_r + 1; when 'V'|'v' => Campo(Tentativo,I):= Verde; T_v :=T_v + 1; when 'G'|'g' => Campo(Tentativo,I):= Giallo; T_g :=T_g + 1; when 'Q'|'q' => raise Eccezione_fuga; when others => Errore_Colore := true; set_col(25); put("--> Colore non valido <--"); delay(0.7); new_line; exit; end case; Put(" "); end loop; when 2 => for I in 1..N_Livello loop put(" "); Get_Immediate(Ch); -- CONSTRAINT_ERROR evitato in "when others" Put(Ch); case Ch is when 'R'|'r' => Campo(Tentativo,I):= Rosso; T_r :=T_r + 1; when 'V'|'v' => Campo(Tentativo,I):= Verde; T_v :=T_v + 1; when 'Q'|'q' => set_col(25); put("--> uscita <--"); raise Eccezione_fuga; when others => Errore_Colore := true; set_col(25); put("--> Colore non valido <--"); delay(0.7); new_line; exit; end case; Put(" "); end loop; when others => null; end case; exit when Errore_colore = false ; end loop; end Get_Colori; -------------------------------------------------------------------------------------------------------------- procedure Crea_V_Soluzione is -- creazione della combinazione da indovinare begin S_r :=0; -- reset delle ricorrenze dei colori S_g :=0; S_b :=0; S_v :=0; S_m :=0; S_c :=0; S_a :=0; Reset (Gen); for I in 1..N_Livello loop Soluzione(I):= Random(Gen); case Soluzione(I) is when Rosso => S_r :=S_r + 1; O_r:=S_r; -- incremento delle ricorrenze dei colori when Giallo => S_g :=S_g + 1; O_g:=S_g; -- e duplicazione per ripristino durante il chk when Bianco => S_b :=S_b + 1; O_b:=S_b; -- le S_x vengono infatti decrementate when Verde => S_v :=S_v + 1; O_v:=S_v; when Magenta => S_m :=S_m + 1; O_m:=S_m; when Ciano => S_c :=S_c + 1; O_c:=S_c; when Azzurro => S_a :=S_a + 1; O_a:=S_a; end case; end loop; end Crea_V_Soluzione; -------------------------------------------------------------------------------------------------------------- procedure Chk_Sol is -- controlla i colori e incrementa i cgpc / cgps begin Cgpg(Tentativo) := 0; Cgps(Tentativo) := 0; for I in 1..N_Livello loop if Campo(Tentativo,I) = Soluzione(I) then --CGPG Cgpg(Tentativo) := Cgpg(Tentativo) + 1; --! case Soluzione(I) is when Rosso => S_r :=S_r - 1; T_r :=T_r - 1; -- diminuzione delle ricorrenze nella soluzione e nel tentativo when Giallo => S_g :=S_g - 1; T_g :=T_g - 1; when Bianco => S_b :=S_b - 1; T_b :=T_b - 1; when Verde => S_v :=S_v - 1; T_v :=T_v - 1; when Magenta => S_m :=S_m - 1; T_m :=T_m - 1; when Ciano => S_c :=S_c - 1; T_c :=T_c - 1; when Azzurro => S_a :=S_a - 1; T_a :=T_a - 1; end case; end if; end loop; -- a questo punto quello che resta o è completamente sbagliato o CGPS if S_r > T_r then -- rosso while T_r > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; T_r := T_r - 1; end loop; elsif T_r > S_r then while S_r > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; S_r := S_r - 1; end loop; elsif S_r = T_r then CGPS(Tentativo) := CGPS(Tentativo) + S_r; end if; if S_g > T_g then -- giallo while T_g > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; T_g := T_g - 1; end loop; elsif T_g > S_g then while S_g > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; S_g := S_g - 1; end loop; elsif S_g = T_g then CGPS(Tentativo) := CGPS(Tentativo) + S_g; end if; if S_b > T_b then -- bianco while T_b > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; T_b := T_b - 1; end loop; elsif T_b > S_b then while S_b > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; S_b := S_b - 1; end loop; elsif S_b = T_b then CGPS(Tentativo) := CGPS(Tentativo) + S_b; end if; if S_v > T_v then -- verde while T_v > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; T_v := T_v - 1; end loop; elsif T_v > S_v then while S_v > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; S_v := S_v - 1; end loop; elsif S_v = T_v then CGPS(Tentativo) := CGPS(Tentativo) + S_v; end if; if S_m > T_m then -- magenta while T_m > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; T_m := T_m - 1; end loop; elsif T_m > S_m then while S_m > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; S_m := S_m - 1; end loop; elsif S_m = T_m then CGPS(Tentativo) := CGPS(Tentativo) + S_m; end if; if S_c > T_c then -- Ciano while T_c > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; T_c := T_c - 1; end loop; elsif T_c > S_c then while S_c > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; S_c := S_c - 1; end loop; elsif S_c = T_c then CGPS(Tentativo) := CGPS(Tentativo) + S_c; end if; if S_a > T_a then -- azzurro while T_a > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; T_a := T_a - 1; end loop; elsif T_a > S_a then while S_a > 0 loop CGPS(Tentativo) := CGPS(Tentativo) + 1; S_a := S_a - 1; end loop; elsif S_a = T_a then CGPS(Tentativo) := CGPS(Tentativo) + S_a; end if; end Chk_Sol; -------------------------------------------------------------------------------------------------------------- procedure Vittoria(Livello : in Natural ; Numcolori : in Natural ; Tentativo : in Natural)is Mio_File : File_Type; Ch : Character; begin put(ascii.esc); put("[2J"); Open(Mio_File,In_File,"mmv.atx"); Put(Ascii.Esc); -- colore giallo Put("[1;33;40m"); for R in 1..18 loop for C in 1..49 loop Get(Mio_File, Ch); Put(Ch); end loop; New_Line; end loop; Close (Mio_File); Put(Ascii.Esc); -- reset colore Put("[0;37;40m"); Put(Ascii.Esc); -- livello Put("[5;47f"); Put(Livello , Width => 0); Put(Ascii.Esc); -- colori Put("[6;47f"); Put(Numcolori , Width => 0); Put(Ascii.Esc); -- tentativi Put("[7;47f"); Put(Tentativo , Width => 0); Put(Ascii.Esc); -- fondo Put("[20;1f"); end Vittoria; -------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------- begin -- in pratica e' la procedura di partenza per giocare IO vs PC Crea_V_Soluzione; put(Ascii.esc); put("[2J"); visualizza(vinto, perso, N_Livello, N_Tentativi, Tentativo, Soluzione, Campo); for I in 1..N_Tentativi loop T_r :=0; S_r:=O_r; -- reset delle ricorrenze per tentativo e soluzione T_g :=0; S_g:=O_g; T_b :=0; S_b:=O_b; T_v :=0; S_v:=O_v; T_m :=0; S_m:=O_m; T_c :=0; S_c:=O_c; T_a :=0; S_a:=O_a; Tentativo := Tentativo + 1; -- un'altro tentativo? bene... loop Get_Colori(campo , Tentativo, T_r, T_v, T_g, T_a, T_m, T_c, T_b , Errore_Colore); --input dei colori X tentativo set_col(25);Put("Controllare questi colori? (S/N) : "); Get(Ch); case Ch is when 'S'|'s' => -- esce per controllare il tentativo exit; when 'N'|'n' => visualizza(vinto, perso, N_Livello, N_Tentativi, Tentativo, Soluzione, Campo); -- visualizza ANCHE quella da non controllare when others => new_line(2); set_col(25); put("--> Tasto errato <--"); delay(0.8); visualizza(vinto, perso, N_Livello, N_Tentativi, Tentativo, Soluzione, Campo); end case; end loop; Chk_Sol; -- controllo soluzioni/tentativo if Cgpg(Tentativo) = N_Livello then Vinto := True; Visualizza(vinto, perso, N_Livello, N_Tentativi, Tentativo, Soluzione, Campo); put("Premi un tasto per continuare"); get_immediate(ch); Vittoria(N_Livello, N_Colori, Tentativo); new_line(4); put("Premi un tasto per tornare al menu iniziale"); get_immediate(ch); exit; end if; Visualizza(vinto, perso, N_Livello, N_Tentativi, Tentativo, Soluzione, Campo); -- visualizza al termine di ogni prova end loop; Perso := True; --visualizza se perdi Visualizza(vinto, perso, N_Livello, N_Tentativi, Tentativo, Soluzione, Campo); put("Premi un tasto per tornare al menu iniziale"); get_immediate(ch); end Gioca; -------------------------------------------------------------------------------------------------------------- procedure Front is -- mostra il titolo del gioco type Cc is range 31..44; package Random_C is new Ada.Numerics.Discrete_Random(Cc); use Random_C; Gen : Random_C.Generator; Codice : Cc; Mio_File : File_Type; Ch : Character; begin Reset (Gen); Codice := Random(Gen); case Codice is -- dark when 31 => Put(Ascii.Esc);-- visualizza in rosso Put("[0;31;40m"); when 32 => Put(Ascii.Esc);-- visualizza in verde Put("[0;32;40m"); when 33 => Put(Ascii.Esc);-- visualizza in giallo Put("[0;33;40m"); when 34 => Put(Ascii.Esc);-- visualizza in blu Put("[0;34;40m"); when 35 => Put(Ascii.Esc);-- visualizza in magenta Put("[0;35;40m"); when 36 => Put(Ascii.Esc);-- visualizza in ciano Put("[0;36;40m"); when 37 => Put(Ascii.Esc);-- visualizza in bianco Put("[0;37;40m"); -- bright when 38 => Put(Ascii.Esc);-- visualizza in rosso Put("[1;31;40m"); when 39 => Put(Ascii.Esc);-- visualizza in verde Put("[1;32;40m"); when 40 => Put(Ascii.Esc);-- visualizza in giallo Put("[1;33;40m"); when 41 => Put(Ascii.Esc);-- visualizza in blu Put("[1;34;40m"); when 42 => Put(Ascii.Esc);-- visualizza in magenta Put("[1;35;40m"); when 43 => Put(Ascii.Esc);-- visualizza in ciano Put("[1;36;40m"); when 44 => Put(Ascii.Esc);-- visualizza in bianco Put("[1;37;40m"); when others => null; end case; Open(Mio_File,In_File,"mmf.atx"); for R in 1..17 loop for C in 1..59 loop Get(Mio_File, Ch); Put(Ch); end loop; New_Line; end loop; Close(Mio_File); Put(Ascii.Esc); -- reset colore Put("[0;37;40m"); end Front; -------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------- procedure Menu is -- menu sotto il titolo iniziale begin loop put(Ascii.esc); put("[2J"); front; set_col(10); put("A - Indovina la combinazione di colori del PC"); new_line; set_col(10); put("B - Scopri quanto e' furbo il tuo PC..sfidalo!!!"); new_line; set_col(10); put("Q - Esci e torna nel grigio mondo"); new_line(3); set_col(10); put(" Seleziona tipo di gioco: "); get(ch); case ch is when 'a'|'A' => Get_livello; Gioca; when 'b'|'B' => put(Ascii.esc);put("[2J");new_line(12); set_col(10); put("il PC e' stanco...non vuole giocare"); delay(0.7); when 'q'|'Q' => new_line(12); set_col(10); put(Ascii.esc); put("[1;37;40m"); put("Spegni il computer e fai qualcosa di piu' costruttivo"); put(Ascii.esc); put("[0;37;40m"); new_line(12); delay(1.0); exit; when others => null; end case; end loop; exception when Eccezione_fuga => put(Ascii.esc);put("[2J");set_col(25); put(Ascii.esc);put("[1;31;40m");put("--> uscita <--");put(Ascii.esc);put("[0;37;40m"); end Menu; ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- begin -- procedura principale... Menu; end Mm;