program million;
const aa='a';bb='b';cc='c';dd='d';
var risp,A,B,C,D,dom,files,y,mychar:string;num,tot,err:integer;fileout : text;
procedure scemo;
begin
writeln('Sei un coglione, torna a casa scemo');
writeln('SOLDI GUADAGNATI: ',tot,' EURO');
readln;
halt;
end;
procedure bravo;
begin
tot:=tot+num*num*2;
writeln('ESATTO SEI PROPRIO UN GENIO');
writeln('SOLDI GUADAGNATI: ',tot,' EURO');
end;
procedure risposte;
begin
if num=1 then begin
if risp=aa then begin bravo;
end
else begin scemo; end;
end;
if num=2 then begin
if risp=bb then begin bravo;
end
else begin scemo; end;
end;
if num =3 then begin
if risp=cc then begin bravo;
end
else begin scemo;end;
end;
if num=4 then begin
if risp=dd then begin bravo;
end
else begin scemo;end;
end;
num:=num+1;
writeln;
writeln;
end;
procedure chiedi;
begin
writeln;
repeat;writeln('La risposta definitiva e.... ');
readln(risp);until(risp='a') or (risp='b') or (risp='c') or (risp='d');
risposte;
end;
procedure testo;
begin
write('DOMANDA n. ',num,':'); writeln(dom);
writeln('RISPOSTE: A. ',A,' B. ',B);
write(' C. ',C,' D. ',D);
chiedi;
end;
procedure domande;
begin
dom:='Chi sei?'; A:='Nessuno';B:='Babel';C:='Nonna Pia';D:='Dio';
num:=1;
testo;
writeln('------------ PROSSIMA DOMANDA ------=[2]=---------');
dom:='Dove siamo?';A:='Rai 1';B:='Boh';C:='Casa di nonna Pia';D:='Alla stazione di polizia';
testo;
writeln('------------ PROSSIMA DOMANDA ------=[3]=--------');
dom:='In che anno e naot BABEL?';A:='1992';B:='1492';C:='1991';D:='BABEL non esiste';
testo;
writeln('------------ PROSSIMA DOMANDA ------=[4]=--------');
dom:='Dove si trova Roma?';A:='Grecia';B:='Russia';C:='USA';D:='Italia';
testo;
writeln('Congratulazioni! Hai finito con ',tot,' Euro!');
writeln('Vuoi savlare questo HighScore? (si/no)'); readln(y);
if y='si' then begin
writeln('Dove lo vorresti salvare? Scrivi la dir. eg. c:\Documents and Settings\jonny\ Desktop\millionario.txt');
readln(files);
assign (fileout, files);
rewrite (fileout);
write('Vorresti essere ricordato come... ');readln(mychar);
writeln (fileout, '--=[Millionare Hall of Fame']=--);
writeln (fileout, '1. ', mychar, ' con ', tot , ' Euro');
close(fileout);
end;
end;
begin
domande;
end.
Copia la roba sopra, salva tutto come mill.pas
Nella procedura RISPOSTE metti le risposte esatte (aa se a, cc se c...)
Nulla procedura DOMANDE metti le domande e le risposte possibili..
Codice:
dom:='DOMANDA?';
A:='RispostaA';B:='RispostaB';C:='RispostaC';D:='RispostaD';