Home - Rasfoiesc.com
Educatie Sanatate Inginerie Business Familie Hobby Legal
Doar rabdarea si perseverenta in invatare aduce rezultate bune.stiinta, numere naturale, teoreme, multimi, calcule, ecuatii, sisteme




Biologie Chimie Didactica Fizica Geografie Informatica
Istorie Literatura Matematica Psihologie

Informatica


Index » educatie » Informatica
» Joc - spanzuratoarea -pentru obtinerea ului in informatica


Joc - spanzuratoarea -pentru obtinerea ului in informatica


GRUP SCOLAR INDUSTRIAL DE PETROL CAMPINA

LUCRARE PENTRU OBTINEREA ATESTATULUI

IN INFORMATICA



Tema lucrarii

JOC - SPANZURATOAREA

JOCUL SPANZURATOAREA

prezentare generala –

Jocul Spanzuratoarea este un joc creat pentru persoanele de toate varstele,fiind un joc destul de simplu de jucat!

In meniul principal al acestui joc intalnim optiunile: JOACA , OPTIUNI , SCORURI , INFO si IESIRE , aceste optiuni putand fi selectate cu ajutorul unui cursor controlat prin sagetile UP si DOWN si apelate prin tastarea butonului ENTER.

Optiunea JOACA

Alegand optiunea JOACA intram in submeniul acesteia unde putem alege tipul de joc preferat, din optiunile 1 jucator si 2 jucatori sau putem ne putem intoarce in meniul principal cu ajutorul optiunii inapoi.

Fiecare din optiunile 1 jucator si 2 jucatori au cate doua moduri de joc.Pentru optiunea 1 jucator avem pagina Selecteaza modul unde intalnim optiunile modul 1, modul 2 si optiunea inapoi care ne trimite in submeniul optiunii JOACA.Modul 1 este modul in care cuvintele pentru joc sunt selectate in mod aleatoriu de program in functie de setarile facute,iar alegand modul 2 cuvintele trebuiesc introduse de la tastatura.

In cazul in care este aleasa optiunea 2 jucatori intram deasemeni in submeniul Selecteaza modul intalnind aceleasi optiuni ca in cazul optiunii 1 jucator , dupa selectarea modului de joc intram in submeniul Dificultate unde intalnim trei graduri de dificultate: usor, normal si dificil, care se deosebesc prin numarul de litere gresite la care jucatorul este spanzurat.

Pentru optiunile 1 jucator si modul 1 dupa ce este aleasa dificultatea jucatorul trebuie sa isi introduca numele pentru a putea fi inregistrat in meniul SCORURI ;in cazul in care au fost alese optiunile 1 jucator si modul 2,an ue este aleasa dificultatea, jucatorul trebuie sa introduca un cuvant care va trebui descoperit de catre an uey.

Daca va fi aleasa varianta 2 jucatori ,modul 1 trebuie introdus numarul de cuvinte pe care trebuie sa le descopere fiecare jucator,cuvintele sunt generate de catre program ,castigand cel care isi descopera cuvintele in cel mai scurt timp sau cel care are cele mai multe cuvinte descoperite in momentul in care unul din jucatori este spanzurat,iar daca nici un jucator nu a descoperit nici un cuvant amandoi sunt pierzatori.

Pentru varianta 2 jucatori, modul 2 dupa alegerea dificultatii,la fel ca la modul 1 trebuie introdus numarul de cuvinte pe care trebuie sa le descopere fiecare jucator diferenta constand in faptul ca fiecare jucator introduce cuvintele ce trebuiesc descoperite de adversar.

- 2 -

Optiunea OPTIUNI

Din submeniul OPTIUNI se gasesc toate setarile jocului:sunet, modul rapid, litere tastate, alege domeniul, creaza/modifica domeniul, alegerea tastelor, alegerea culorrilor si butonul de iesire.

SUNET – aceasta optiune activeaza(daca este ON) sau dezactiveaza(daca este OFF) sunetul in joc.Folositi tastele sagetilor pentru a schimba aceasta optiune.

MODUL RAPID – este o optiune care va permite sa savurati momentul spanzurarii foarte incet(daca este ON), in caz contrar spanzurarea se desfasoara in mod normal.La 2 jucatori este preferat ca aceasta optiune sa nu fie activata.

LITERE TASTATE – atunci cand optiunea litere testate este ON literele sunt introduse direct, daca este OFF literele sunt schimbate si selectate cu ajutorul tastelor introduse de jucator din meniul alegerea tastelor .De specificat este faptul ca aceasta optiune poate fi active doar la modul 1 jucator.

ALEGE DOMENIUL – aceasta optiune va permite selectarea domeniului din care doriti sa faca parte cuvintele din joc. Domeniile puse la dispozitie sunt : orase, biologie, animale si diverse sau in cazul in care este aleasa optiunea random ,atunci cuvintele vor fi alese din toate domeniile existente.

CREAZA / MODIFICA DOMENIUL – in cazul in care doriti sa mai introduceti cuvinte intr-un domeniu, sau sa create un nou domeniu , locul va permite acest lucru prin optiunea Creaza / modifica domeniul.

ALEGEREA TASTELOR – aceasta optiune va permite alegerea tastelor cu care doriti sa jucati.

ALEGEREA CULORILOR – joclu va ofera posibilitatea de a alege culorile spanzuratorii asa cum doriti dumneavoastra.

IESIRE – aceasta optiune va trimite inapoi in meniul principal.Modificarile pe care le-ati facut in acest meniu vor fi salvate.

Optiunea SCORURI

In aceasta optiune gasim lista cu numele jucatorilor impreuna cu numarul de cuvinte descoperite si gradul de dificultate la care au jucat(usor,normal sau greu ).

Optiunea INFO

In acest submeniu gasim date despre persoanele care au contribuit la realizarea acestui joc:

programare;

muzica si sunet;

grafica si animatie;

crearea domeniilor;

- 3 -

textile;

scanare de virusi;

creator.

Optiunea IESIRE

Aceasta optiune este optiunea prin care se poate parasi programul.

JOCUL SPANZURATOAREA

- structura programului -

unit grafica;

interface

uses graph,crt,dos;

procedure cursor(x,y:integer);

procedure no_cursor(x,y:integer);

procedure main_menu(n1,n2,n3,n4,n5:string;var op:integer);

procedure menu(nume,n1,n2,n3:string;var op:integer);

procedure option(var op:integer);

function cauta(x:integer):string;

procedure highscore;

implementation

function cauta; 

i:integer;

begin

i:=0;

assign(f,'settings.cfg');

reset(f);

while (not eof(f)) and (i<>x) do

begin

inc(i);

readln(f,s);

end;

close(f);

cauta:=s;

end;

procedure cursor(x,y:integer); 

setcolor(2);

setfillstyle(1,2);

bar(x,y,x+40,y+20);

setcolor(13);

setfillstyle(1,13);

- 4 -

line(x+41,y-10,x+41,y+30);

line(x+41,y-10,x+60,y+10);

line(x+41,y+30,x+60,y+10);

triangle[1].x:=x+41;triangle[1].y:=y-10;

triangle[2].x:=x+41;triangle[2].y:=y+30;

triangle[3].x:=x+60;triangle[3].y:=y+10;

FillPoly(SizeOf(Triangle) div SizeOf(PointType), Triangle);

end;

procedure no_cursor(x,y:integer);

procedure main_menu; 

bar3d(200,100,400,150,10,true);

bar3d(200,170,400,220,10,true);

bar3d(200,240,400,290,10,true);

bar3d(200,310,400,360,10,true);

bar3d(200,380,400,430,10,true);

setcolor(4);

settextstyle(10,0,3);

outtextxy(230,100,n1);

outtextxy(230,170,n2);

outtextxy(230,240,n3);

outtextxy(230,310,n4);

outtextxy(230,380,n5);

x:=100;y:=115;

cursor(x,y);

repeat

c:=readkey;

case c of

#72:if o>1 then

begin no_cursor(x,y);y:=y-70;dec(o);cursor(x,y);end;

#80:if o<5 then

begin no_cursor(x,y);y:=y+70;inc(o);cursor(x,y);end;

end;

if cauta(1)='ON' then

begin

sound(400);

delay(20);

sound(600);

delay(50);

nosound;

end;

until c=#13;

op:=o;

end;

procedure menu; 

bar(1,1,640,480);

setcolor(6);

- 5 -

if length(nume)<8 then

begin

settextstyle(1,0,8);

outtextxy(120,50,nume);

end

else

begin

settextstyle(1,0,7);

outtextxy(30,50,nume);

end;

setcolor(14);

setfillstyle(1,14);

bar3d(200,200,400,250,10,true);

bar3d(200,270,400,320,10,true);

bar3d(200,340,400,390,10,true);

setcolor(4);

settextstyle(10,0,3);

outtextxy(220,200,n1);

outtextxy(220,270,n2);

outtextxy(220,340,n3);

x:=100;y:=215;

cursor(x,y);

repeat

c:=readkey;

case c of

#72:if o>1 then

begin no_cursor(x,y);y:=y-70;dec(o);cursor(x,y);end;

#80:if o<3 then

begin no_cursor(x,y);y:=y+70;inc(o);cursor(x,y);end;

end;

if cauta(1)='ON' then

begin

sound(400);

delay(20);

sound(600);

delay(50);

nosound;

end;

until c=#13;

op:=o;

end;

procedure option; 

var cod,x,o,n, c_fond, c_span, c_ata,

c_cap, c_ochi, c_nas, c_gura, c_gat,

c_trunchi, c_membre:integer;

c:char;

f1,f2,b1,b2,u1,u2:string;

sunet,fast,key,domain:string;

domenii:vector;

f:text;

procedure spanzurica(c_fond, c_span,

c_gat, c_trunchi, c_membre:integer);

begin

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(400,1,630,480);

setcolor(c_span);

setfillstyle(1, c_span);

bar(600,100,620,470);

bar(600,100,500,130);

setcolor(c_ata);

setlinestyle(0,0,3);

line(520,130,520,150);

line(520,150,510,180);

line(520,150,530,180);

- 6 -

arc(520,180,180,0,10);

setlinestyle(0,0,2);

setcolor(c_cap);

setfillstyle(1, c_cap);

pieslice(520,180,0,360,30);

setcolor(c_ochi);

setfillstyle(1, c_ochi);

pieslice(505,170,0,360,5);

pieslice(535,170,0,360,5);

setcolor(1);

setfillstyle(1,1);

pieslice(505,172,0,360,3);

pieslice(535,172,0,360,3);

setcolor(c_nas);

setlinestyle(0,0,3);

line(520,175,520,185);

line(520,185,515,189);

line(520,185,525,189);

setlinestyle(0,0,2);

setcolor(c_gura);

setlinestyle(0,0,3);

ellipse(520,190,180,360,15,10);

setlinestyle(0,0,2);

setcolor(c_gat);

setlinestyle(0,0,3);

line(520,211,520,225);

line(518,211,518,225);

line(522,211,522,225);

setlinestyle(0,0,2);

setcolor(c_trunchi);

setfillstyle(1, c_trunchi);

bar(500,225,540,300);

setcolor(c_membre);

setlinestyle(0,0,3);

line(500,230,480,270);

line(480,270,474,265);

line(480,270,470,270);

line(480,270,470,276);

line(480,270,476,280);

line(480,270,483,278);

setlinestyle(0,0,2);

setcolor(c_membre);

setlinestyle(0,0,3);

line(540,230,560,270);

line(560,270,566,265);

line(560,270,570,270);

line(560,270,570,276);

line(560,270,564,280);

line(560,270,557,278);

setlinestyle(0,0,2);

setcolor(c_membre);

setlinestyle(0,0,3);

line(515,300,515,370);

line(515,370,505,370);

setlinestyle(0,0,2);

setcolor(c_membre);

setlinestyle(0,0,3);

line(525,300,525,370);

line(525,370,535,370);

setlinestyle(0,0,2);

end;

procedure culori(var c_fond, c_span,

settextstyle(1,0,4);

setcolor(14);

outtextxy(80,50,'Fond');

outtextxy(80,90,'Spanzuratoarea');

outtextxy(80,130,'Streang');

outtextxy(80,170,'Cap');

outtextxy(80,210,'Ochii');

outtextxy(80,250,'Nas');

outtextxy(80,290,'Gur†');

outtextxy(80,330,'Gat');

outtextxy(80,370,'Trunchi');

outtextxy(80,410,'Membre');

setcolor(c_fond); setfillstyle(1, c_fond); bar3d(160,60,210,85,5,true);

setcolor(c_span); setfillstyle(1, c_span); bar3d(330,100,380,125,5,true);

setcolor(c_ata); setfillstyle(1, c_ata); bar3d(210,140,260,165,5,true);

setcolor(c_cap); setfillstyle(1, c_cap); bar3d(145,180,195,205,5,true);

setcolor(c_ochi); setfillstyle(1, c_ochi); bar3d(170,220,220,245,5,true);

setcolor(c_nas); setfillstyle(1, c_nas); bar3d(145,260,195,285,5,true);

setcolor(c_gura); setfillstyle(1, c_gura); bar3d(160,300,210,325,5,true);

setcolor(c_gat); setfillstyle(1, c_gat); bar3d(145,340,195,365,5,true);

setcolor(c_trunchi); setfillstyle(1, c_trunchi); bar3d(210,380,260,405,5,true);

setcolor(c_membre); setfillstyle(1, c_membre); bar3d(210,420,260,445,5,true);

sagetutza(x,y);

c:=readkey;

if (c=#72) and(x>=1) then begin dec(x);y:=0;q:=false;end;

if (c=#80) and(x<=8) then begin inc(x);y:=1;q:=false;end;

if (c=#75) then begin

q:=true;

case x of

0:if c_fond>0 then dec(c_fond);

1:if c_span>0 then dec(c_span);

2:if c_ata>0 then dec(c_ata);

- 8 -

3:if c_cap>0 then dec(c_cap);

4:if c_ochi>0 then dec(c_ochi);

5:if c_nas>0 then dec(c_nas);

6:if c_gura>0 then dec(c_gura);

7:if c_gat>0 then dec(c_gat);

8:if c_trunchi>0 then dec(c_trunchi);

9:if c_membre>0 then dec(c_membre);

end;

end;

if (c=#77) then begin

q:=true;

case x of

0:if c_fond<16 then inc(c_fond);

1:if c_span<16 then inc(c_span);

2:if c_ata<16 then inc(c_ata);

3:if c_cap<16 then inc(c_cap);

4:if c_ochi<16 then inc(c_ochi);

5:if c_nas<16 then inc(c_nas);

6:if c_gura<16 then inc(c_gura);

7:if c_gat<16 then inc(c_gat);

8:if c_trunchi<16 then inc(c_trunchi);

9:if c_membre<16 then inc(c_membre);

end;

end;

if cauta(1)='ON' then

begin

sound(400);

delay(20);

sound(600);

delay(50);

nosound;

end;

until c=#27;

assign(f,'settings.cfg');

erase(f);

assign(f,'settings.cfg');

rewrite(f);

writeln(f,sunet);

writeln(f,fast);

writeln(f,key);

writeln(f,domain);

writeln(f,f1);writeln(f,b1);writeln(f,u1);

writeln(f,f2);writeln(f,b2);writeln(f,u2);

writeln(f, c_fond);writeln(f, c_span);writeln(f, c_ata);

writeln(f, c_cap);writeln(f, c_ochi);writeln(f, c_nas);

writeln(f, c_gura);writeln(f, c_gat);writeln(f, c_trunchi);

writeln(f, c_membre);

close(f);

end;

procedure control(var f1,b1,u1,f2,b2,u2:string);

setcolor(0);

if y=0 then outtextxy(10,50+(x+1)*40,'-->')

else outtextxy(10,50+(x-1)*40,'-->');

setcolor(15);

outtextxy(10,50+x*40,'-->');

if x=4 then

begin

setcolor(0);

outtextxy(10,50+(x+3)*40,'-->');

end;

if x=7 then

- 9 -

begin

setcolor(0);

outtextxy(10,50+(x-3)*40,'-->');

end;

end;

begin

setfillstyle(0,0);

bar(1,1,640,480);

x:=2;y:=0;

repeat

settextstyle(1,0,5);

setcolor(4);

outtextxy(10,50,'Juc†tor 1');

settextstyle(1,0,4);

setcolor(14);

outtextxy(80,130,'Stƒnga:');

outtextxy(80,170,'Dreapta:');

outtextxy(80,210,'Enter:');

settextstyle(1,0,5);

setcolor(4);

outtextxy(10,250,'Juc†tor 2');

settextstyle(1,0,4);

setcolor(14);

outtextxy(80,330,'Stƒnga:');

outtextxy(80,370,'Dreapta:');

outtextxy(80,410,'Enter:');

setcolor(15);

outtextxy(250,130,f1);

outtextxy(250,170,b1);

outtextxy(250,210,u1);

outtextxy(250,330,f2);

outtextxy(250,370,b2);

outtextxy(250,410,u2);

sagetutza(x,y);

c:=readkey;

if (c=#72) and(x>=3) then begin dec(x);y:=0;if x=6 then begin x:=4;y:=1;end;end;

if (c=#80) and(x<=8) then begin inc(x);y:=1;if x=5 then x:=7;end;

if c=#13 then

begin

if x=2 then

begin

setfillstyle(0,0);

bar(240,140,290,175);

outtextxy(250,130,'_');

repeat

c:=readkey;

until (ord(c)>=33) and(ord(c)<=126);

bar(240,140,290,175);

outtextxy(250,130,c);

f1:=c;

end;

if x=3 then

begin

setfillstyle(0,0);

bar(240,180,290,215);

outtextxy(250,170,'_');

repeat

c:=readkey;

until (ord(c)>=33) and(ord(c)<=126);

bar(240,180,290,215);

outtextxy(250,170,c);

b1:=c;

end;

if x=4 then

begin

setfillstyle(0,0);

bar(240,220,290,255);

outtextxy(250,210,'_');

- 10 -

repeat

c:=readkey;

until (ord(c)>=33) and(ord(c)<=126);

bar(240,220,290,255);

outtextxy(250,210,c);

u1:=c;

end;

if x=7 then

begin

setfillstyle(0,0);

bar(240,340,290,375);

setcolor(15);

outtextxy(250,330,'_');

repeat

c:=readkey;

until (ord(c)>=33) and(ord(c)<=126);

bar(240,340,290,375);

outtextxy(250,330,c);

f2:=c;

end;

if x=8 then

begin

setfillstyle(0,0);

bar(240,380,290,415);

outtextxy(250,370,'_');

repeat

c:=readkey;

until (ord(c)>=33) and(ord(c)<=126);

bar(240,380,290,415);

outtextxy(250,370,c);

b2:=c;

end;

if x=9 then

begin

setfillstyle(0,0);

bar(240,420,290,455);

outtextxy(250,410,'_');

repeat

c:=readkey;

until (ord(c)>=33) and(ord(c)<=126);

bar(240,420,290,455);

outtextxy(250,410,c);

u2:=c;

end;

end;

if cauta(1)='ON' then

begin

sound(400);

delay(20);

sound(600);

delay(50);

nosound;

end;

until c=#27;

assign(f,'settings.cfg');

erase(f);

assign(f,'settings.cfg');

rewrite(f);

writeln(f,sunet);

writeln(f,fast);

writeln(f,key);

writeln(f,domain);

writeln(f,f1);writeln(f,b1);writeln(f,u1);

writeln(f,f2);writeln(f,b2);writeln(f,u2);

writeln(f, c_fond);writeln(f, c_span);writeln(f, c_ata);

writeln(f, c_cap);writeln(f, c_ochi);writeln(f, c_nas);

- 11 -

writeln(f, c_gura);writeln(f, c_gat);writeln(f, c_trunchi);

writeln(f, c_membre);

close(f);

end;

procedure createdomain;

erase(f);

assign(f,'settings.cfg');

rewrite(f);

writeln(f,sunet);

writeln(f,fast);

writeln(f,key);

writeln(f,domain);

writeln(f,f1);writeln(f,b1);writeln(f,u1);

writeln(f,f2);writeln(f,b2);writeln(f,u2);

writeln(f, c_fond);writeln(f, c_span);writeln(f, c_ata);

writeln(f, c_cap);writeln(f, c_ochi);writeln(f, c_nas);

writeln(f, c_gura);writeln(f, c_gat);writeln(f, c_trunchi);

writeln(f, c_membre);

close(f);

closegraph;

textbackground(1);

clrscr;

textcolor(15);

repeat

writeln('Numele domeniului pe care vreti sa-l creati sau sa mai adaugati cuvinte Œm el:');

write('--->');readln(nume);

until length(nume)>=1;

Assign(f,nume+'.dmn');

append(f);

if IOResult<>0 then begin rewrite(f);writeln('Domeniul a fost creat.');

writeln('Apasati ENTER pentru a continua cu scrierea cuvintelor.');readln;

end

else begin writeln('Domeniul a fost deschis pentru adaugare de cuvinte,apasati ENTER.');readln;end;

clrscr;

i:=0;

repeat

inc(i);

repeat

ww:=true;

textcolor(13);

repeat

write('Cuvantul nr.',i,':');

textcolor(14);

readln(s);

if length(s)<=3 then writeln('Cuvantul trebuie sa contina mai mult de 3 litere.');

if length(s)>17 then writeln('Cuvantul trebuie sa contina mai putin de 18 litere.');

until (length(s)>3) and(length(s)<18);

for j:=1 to length(s) do

if (ord(s[j])<97) or(ord(s[j])>122)then ww:=false;

if not ww then

begin

textcolor(4);

writeln('Cuvantul trebuie sa contina doar litere mici.');

readln;

end;

until ww;

writeln(f,s);

textcolor(6);

- 12 -

writeln('Mai adaugati cuvinte?');

writeln('ESC. pentru NU,orice tasta pentru DA.');

c:=readkey;

textcolor(2);

writeln('<-------- ----- ------ -------- ----- ------ ------------>');

until c=#27;

close(f);

dr:=detect;

initgraph(dr,mo,' ');

end;

procedure pune(n:integer);

begin

if n=1 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,10,'SUNET << >>');

end;

if n=2 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,50,'MODUL RAPID << >>');

end;

if n=3 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,90,'LITERE TASTATE << >>');

end;

if n=4 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,130,'ALEGE DOMENIUL << >>');

end;

if n=5 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,170,'CREAZA/MODIFICA DOMENIUL');

end;

if n=6 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,210,'ALEGEREA TASTELOR');

end;

if n=7 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,250,'ALEGEREA CULORILOR');

end;

if n=8 then

begin

setcolor(2);

settextstyle(8,0,1);

outtextxy(110,290,'IESIRE');

end;

end;

procedure ia(n:integer); 

if n=1 then

begin

setcolor(4);

- 13 -

settextstyle(8,0,1);

outtextxy(110,10,'SUNET << >>');

end;

if n=2 then

begin

setcolor(4);

settextstyle(8,0,1);

outtextxy(110,50,'MODUL RAPID << >>');

end;

if n=3 then

begin

setcolor(4);

settextstyle(8,0,1);

outtextxy(110,90,'LITERE TASTATE << >>');

end;

if n=4 then

begin

setcolor(4);

settextstyle(8,0,1);

outtextxy(110,130,'ALEGE DOMENIUL << >>');

end;

if n=5 then

begin

setcolor(4);

settextstyle(8,0,1);

outtextxy(110,170,'CREAZA/MODIFICA DOMENIUL');

end;

if n=6 then

begin

setcolor(4);

settextstyle(8,0,1);

outtextxy(110,210,'ALEGEREA TASTELOR');

end;

if n=7 then

begin

setcolor(4);

settextstyle(8,0,1);

outtextxy(110,250,'ALEGEREA CULORILOR');

end;

if n=8 then

begin

setcolor(4);

settextstyle(8,0,1);

outtextxy(110,290,'IESIRE');

end;

end;

procedure schimba(m:integer;var s:string);

var q:boolean;

i,x:integer;

begin

if m=1 then

begin

q:=true;

settextstyle(8,0,1);

if s='ON' then

begin setcolor(1); setfillstyle(1,1); bar(420,10,457,40); setcolor(13); outtextxy(420,10,'OFF');s:='OFF';q:=false;end;

if (s='OFF') and q then

begin setcolor(1); setfillstyle(1,1); bar(420,10,457,40); setcolor(13); outtextxy(420,10,'ON');s:='ON';q:=false;end;

end;

if m=2 then

begin

q:=true;

settextstyle(8,0,1);

if s='ON' then

begin setcolor(1); setfillstyle(1,1); bar(425,50,459,80); setcolor(13); outtextxy(425,50,'OFF');s:='OFF';q:=false;end;

if (s='OFF') and q then

begin setcolor(1); setfillstyle(1,1); bar(425,50,459,80); setcolor(13); outtextxy(425,50,'ON');s:='ON';q:=false;end;

end;

- 14 -

if m=3 then

begin

q:=true;

settextstyle(8,0,1);

if s='ON' then

begin setcolor(1); setfillstyle(1,1); bar(432,90,467,120); setcolor(13); outtextxy(432,90,'OFF');s:='OFF';q:=false;end;

if (s='OFF') and q then

begin setcolor(1); setfillstyle(1,1); bar(432,90,467,120); setcolor(13); outtextxy(432,90,'ON');s:='ON';q:=false;end;

end;

if m=4 then

begin

settextstyle(8,0,1);

for i:=1 to n do

if s=domenii[i] then x:=i;

if x<n then

s:=domenii[x+1]

else

s:=domenii[1];

setcolor(1);

setfillstyle(1,1);

bar(363,130,470,160);

setcolor(13);

outtextxy(363,130,s);

end;

end;

procedure cauta_domenii(var v:vector;var n:integer); 

FindFirst('*.dmn',$3F, Dir);

s:=dir.name;

if (s[length(s)]='N') then delete(s,length(s)-1,2);

if (s[length(s)]='M') then delete(s,length(s)-1,2);

if (s[length(s)]='D') then delete(s,length(s)-1,2);

if (s[length(s)]='.') then delete(s,length(s)-1,2);

v[i]:=s;

while DosError = 0 do

begin

FindNext(Dir);

inc(i);

s:=dir.name;

if (s[length(s)]='N') then delete(s,length(s)-1,2);

if (s[length(s)]='M') then delete(s,length(s)-1,2);

if (s[length(s)]='D') then delete(s,length(s)-1,2);

if (s[length(s)]='.') then delete(s,length(s)-1,2);

v[i]:=s;

end;

n:=i;

end;

begin

1:cauta_domenii(domenii,n);

o:=1;

setcolor(0);

setfillstyle(1,0);

bar(1,1,640,480);

setcolor(1);

setfillstyle(1,1);

bar(1,1,500,400);

setcolor(14);

settextstyle(10,1,7);

outtextxy(-20,10,'OPTIUNI');

setcolor(2);

settextstyle(8,0,1);

- 15 -

outtextxy(110,10,'SUNET << >>');

setcolor(4);

outtextxy(110,50,'MODUL RAPID << >>');

outtextxy(110,90,'LITERE TASTATE << >>');

outtextxy(110,130,'ALEGE DOMENIUL << >>');

outtextxy(110,170,'CREAZA/MODIFICA DOMENIUL');

outtextxy(110,210,'ALEGEREA TASTELOR');

outtextxy(110,250,'ALEGEREA CULORILOR');

outtextxy(110,290,'IESIRE');

f1:=cauta(5);b1:=cauta(6); u1:=cauta(7);f2:=cauta(8); b2:=cauta(9);u2:=cauta(10);

val (cauta(12),x,cod);c_span:=x;val (cauta(13),x,cod);c_ata:=x;

val (cauta(14),x,cod);c_cap:=x;val (cauta(15),x,cod);c_ochi:=x;

val (cauta(16),x,cod);c_nas:=x;val (cauta(17),x,cod);c_gura:=x;

val (cauta(18),x,cod);c_gat:=x;val (cauta(19),x,cod);c_trunchi:=x;

val (cauta(20),x,cod);c_membre:=x;val (cauta(11),x,cod);c_fond:=x;

sunet:=cauta(1);

fast:=cauta(2);

key:=cauta(3);

domain:=cauta(4);

setcolor(13);

outtextxy(420,10,sunet);

outtextxy(425,50,fast);

outtextxy(432,90,key);

outtextxy(363,130,domain);

repeat

setcolor(0);

setfillstyle(1,0);

bar(1,400,640,480);

setcolor(10);

settextstyle(2,0,5);

outtextxy(1,400,'sus,jos ---------->pentru a selecta optiunile');

outtextxy(1,420,'stanga,dreapta --->pentru a modifica optiunile selectate');

outtextxy(1,440,'ENTER ------------>pentru a intra Œn optiunile selectate');

if o=1 then

begin

setcolor(0);

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,'Optiunea SUNET activeaza');

outtextxy(500,20,'(daca este ON) sau ');

outtextxy(500,40,'dezactiveaza (daca este ');

outtextxy(500,60,'OFF) sunetul Œn joc.');

outtextxy(500,80,'Folositi tastele sageti');

outtextxy(500,100,'ca sa schimbati aceasta');

outtextxy(500,120,'optiune.');

end;

if o=2 then

begin

setcolor(0);

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,'MODUL RAPID este o');

outtextxy(500,20,'optiune care va permite');

outtextxy(500,40,'sa savurati momentul');

outtextxy(500,60,'spanzurarii foarte Œncet');

outtextxy(500,80,'(daca este ON),Œn caz');

outtextxy(500,100,'contrar spanzurarea se');

outtextxy(500,120,'desfasoara normal.');

outtextxy(500,140,'La 2 jucatori este de ');

outtextxy(500,160,'preferat ca aceasta ');

outtextxy(500,180,'optiune sa nu fie ');

outtextxy(500,200,'activata.');

end;

if o=3 then

- 16 -

begin

setcolor(0);

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,'Atunci cand optiunea');

outtextxy(500,20,'LITERE TASTATE este ON');

outtextxy(500,40,'literele sunt introduse');

outtextxy(500,60,'direct,daca este OFF ');

outtextxy(500,80,'literele sunt schimbate');

outtextxy(500,100,'si selectate cu ajutorul');

outtextxy(500,120,'tastelor introduse de ');

outtextxy(500,140,'voi Œn meniul <alegerea ');

outtextxy(500,160,'tastelor>.De specificat');

outtextxy(500,180,'este faptul ca aceasta');

outtextxy(500,200,'optiune este valabila');

outtextxy(500,220,'doar la modul 1 jucator.');

end;

if o=4 then

begin

setcolor(0);

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,' Aceasta optiune va ');

outtextxy(500,20,' permite selectarea');

outtextxy(500,40,' domeniului din care');

outtextxy(500,60,' doriti sa faca parte');

outtextxy(500,80,' cuvintele din joc.');

outtextxy(500,100,' Œn cazul Œn care');

outtextxy(500,120,' alegeti RANDOM,atunci');

outtextxy(500,140,' cuvintele va vor fi');

outtextxy(500,160,' alese din toate ');

outtextxy(500,180,' domeniile existente.');

end;

if o=5 then

begin

setcolor(0);

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,'Œn cazul Œn care doriti');

outtextxy(500,20,'sa mai introduceti ');

outtextxy(500,40,'cuvinte Œntr-un domeniu ');

outtextxy(500,60,'sau sa creati un nou ');

outtextxy(500,80,'domeniu jocul va permite ');

outtextxy(500,100,'acest lucru prin ');

outtextxy(500,120,'optiunea CREAZA/MODIFICA ');

outtextxy(500,140,'DOMENIUL. ');

end;

if o=6 then

begin

setcolor(0);

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,' Aceast† optiune va ');

outtextxy(500,20,' permite alegerea');

outtextxy(500,40,' tastelor cu care');

outtextxy(500,60,' doriti sa jucati.');

end;

if o=7 then

begin

setcolor(0);

- 17 -

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,' Jocul va ofera');

outtextxy(500,20,' posibilitatea de a');

outtextxy(500,40,' alege culorile');

outtextxy(500,60,' spanzuratorii asa');

outtextxy(500,80,' cum doriti d-voastra.');

end;

if o=8 then

begin

setcolor(0);

setfillstyle(1,0);

bar(500,1,640,480);

setcolor(11);

settextstyle(2,0,4);

outtextxy(500,1,' Œnapoi Œn meniul ');

outtextxy(500,20,' principal.');

outtextxy(500,40,' Modificarile pe care');

outtextxy(500,60,' le-ati facut Œn acest');

outtextxy(500,80,' meniu vor fi salvate.');

end;

c:=readkey;

case c of

#72:if o>1 then begin ia(o);dec(o);pune(o);end;

#80:if o<8 then begin ia(o);inc(o);pune(o);end;

#75,#77:begin

if o=1 then schimba(o,sunet);

if o=2 then schimba(o,fast);

if o=3 then schimba(o,key);

if o=4 then schimba(o,domain);

end;

#13:begin

if o=7 then begin culori(c_fond, c_span, c_ata, c_cap, c_ochi, c_nas, c_gura, c_gat, c_trunchi, c_membre);

goto 1;

end;

if o=6 then begin control(f1,b1,u1,f2,b2,u2);goto 1;end;

if o=5 then begin createdomain;goto 1;end;

end;

end;

if cauta(1)='ON' then

begin

sound(400);

delay(20);

sound(600);

delay(50);

nosound;

end;

until (o=8) and(c=#13);

assign(f,'settings.cfg');

erase(f);

assign(f,'settings.cfg');

rewrite(f);

writeln(f,sunet);

writeln(f,fast);

writeln(f,key);

writeln(f,domain);

writeln(f,f1);writeln(f,b1);writeln(f,u1);

writeln(f,f2);writeln(f,b2);writeln(f,u2);

writeln(f, c_fond);writeln(f, c_span);writeln(f, c_ata);

writeln(f, c_cap);writeln(f, c_ochi);writeln(f, c_nas);

writeln(f, c_gura);writeln(f, c_gat);writeln(f, c_trunchi);

writeln(f, c_membre);

close(f);

- 18 -

end;

procedure highscore;

textbackground(1);

clrscr;

assign(f,'highscor.hsc');

reset(f);

if IOResult<>0 then begin textcolor(4+blink);gotoxy(30,10);writeln('NU EXISTA SCORURI!');end

else

begin

textcolor(10+blink);gotoxy(30,2);writeln('SCORURI');

writeln;writeln;writeln;

textcolor(15);

while not eof(f)do

begin

readln(f,s);

writeln(s);

end;

textcolor(6);

writeln('Apasa ENTER pentru a continua');

end;

readln;

dr:=detect;

initgraph(dr,mo,' ');

end;

BEGIN

END.

unit prog;

INTERFACE

uses crt,graph,dos,grafica;

procedure cuvant(a:string;var b:string);

procedure fond(bk:integer);

procedure spanzura(pas,fast,modul, c_span, c_ata, c_cap, c_ochi, c_nas, c_gura, c_gat, c_trunchi, c_membre:integer);

function genereaza(domeniu:string):string;

procedure spanzuratoarea(op_mode, op_dificulty:integer);

procedure litere(var c:char;var cine:integer;var c1,c2:char;pl:integer);

procedure spanzura2(var pas1,pas2:integer;fast,modul, c_span, c_ata, c_cap, c_ochi, c_nas, c_gura, c_gat, c_trunchi, c_membre:integer);

procedure fond1(bk:integer);

procedure fond2(bk:integer);

procedure spanzuratoarea2(op_mode, op_dificulty:integer);

procedure help;

IMPLEMENTATION

procedure cuvant;

if (b[i]<>b[1]) and(b[i]<>b[length(b)])then b[i]:='_';

end;

procedure fond; 

begin

setcolor(bk);

setfillstyle(1,bk);

bar(1,1,640,480);

end;

procedure spanzura;  - modul:integer – variabila

setcolor(c_span);  ce defineste gradul de dificultate}

setfillstyle(1, c_span);

bar(600,100,620,470);

bar(600,100,500,130);

end;

if ((pas=1) and(modul=3)) or((pas=0) and((modul=2) or(modul=1))) then

begin

if fast=0 then

begin

setcolor(c_ata);

setlinestyle(0,0,3);

line(520,130,520,150);

line(520,150,510,180);

line(520,150,530,180);

arc(520,180,180,0,10);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_ata);

setlinestyle(0,0,3);

line(520,130,520,150);

delay(20);

line(520,150,510,180);

delay(20);

line(520,150,530,180);

delay(20);

arc(520,180,180,0,10);

delay(20);

setlinestyle(0,0,2);

end;

end;

if ((pas=2) and(modul=3)) or((pas=1) and((modul=2) or(modul=1))) then

begin

if fast=0 then

begin

setcolor(c_cap);

setfillstyle(1, c_cap);

pieslice(520,180,0,360,30);

end

else

begin

setcolor(c_cap);

setfillstyle(1, c_cap);

for i:=1 to 360 do

begin

pieslice(520,180,0,i,30);

delay(10);

end;

end;

end;

if ((pas=2) and(modul=1)) or((pas=2) and(modul=2)) or((pas=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_ochi);

setfillstyle(1, c_ochi);

pieslice(505,170,0,360,5);

pieslice(535,170,0,360,5);

setcolor(1);

setfillstyle(1,1);

pieslice(505,172,0,360,3);

- 20 -

pieslice(535,172,0,360,3);

end

else

begin

setcolor(c_ochi);

setfillstyle(1, c_ochi);

pieslice(505,170,0,360,5);

delay(20);

pieslice(535,170,0,360,5);

delay(20);

setcolor(1);

setfillstyle(1,1);

pieslice(505,172,0,360,3);

delay(20);

pieslice(535,172,0,360,3);

delay(20);

end;

end;

if ((pas=3) and(modul=1)) or((pas=2) and(modul=2)) or((pas=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_nas);

setlinestyle(0,0,3);

line(520,175,520,185);

line(520,185,515,189);

line(520,185,525,189);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_nas);

setlinestyle(0,0,3);

line(520,175,520,185);

delay(20);

line(520,185,515,189);

delay(20);

line(520,185,525,189);

delay(20);

setlinestyle(0,0,2);

end;

end;

if ((pas=4) and(modul=1)) or((pas=2) and(modul=2)) or((pas=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_gura);

setlinestyle(0,0,3);

ellipse(520,190,180,360,15,10);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_gura);

setlinestyle(0,0,3);

for i:=181 to 360 do

begin

ellipse(520,190,180,i,15,10);

delay(10);

end;

setlinestyle(0,0,2);

end;

end;

if ((pas=5) and(modul=1)) or((pas=1) and(modul=2)) or((pas=3) and(modul=3)) then

- 21 -

begin

if fast=0 then

begin

setcolor(c_gat);

setlinestyle(0,0,3);

line(520,211,520,225);

line(518,211,518,225);

line(522,211,522,225);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_gat);

setlinestyle(0,0,3);

for i:=212 to 225 do

begin

line(520,211,520,i);

line(518,211,518,i);

line(522,211,522,i);

delay(10);

end;

setlinestyle(0,0,2);

end;

end;

if ((pas=6) and(modul=1)) or((pas=3) and(modul=2)) or((pas=3) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_trunchi);

setfillstyle(1, c_trunchi);

bar(500,225,540,300);

end

else

begin

setcolor(c_trunchi);

setfillstyle(1, c_trunchi);

for i:=226 to 300 do

begin

bar(500,225,540,i);

delay(10);

end;

end;

end;

if ((pas=7) and(modul=1)) or((pas=4) and(modul=2)) or((pas=4) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(500,230,480,270);

line(480,270,474,265);

line(480,270,470,270);

line(480,270,470,276);

line(480,270,476,280);

line(480,270,483,278);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(500,230,480,270);

delay(15);

line(480,270,474,265);

delay(15);

- 22 -

line(480,270,470,270);

delay(15);

line(480,270,470,276);

delay(15);

line(480,270,476,280);

delay(15);

line(480,270,483,278);

setlinestyle(0,0,2);

end;

end;

if ((pas=8) and(modul=1)) or((pas=5) and(modul=2)) or((pas=4) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(540,230,560,270);

line(560,270,566,265);

line(560,270,570,270);

line(560,270,570,276);

line(560,270,564,280);

line(560,270,557,278);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(540,230,560,270);

delay(15);

line(560,270,566,265);

delay(15);

line(560,270,570,270);

delay(15);

line(560,270,570,276);

delay(15);

line(560,270,564,280);

delay(15);

line(560,270,557,278);

setlinestyle(0,0,2);

end;

end;

if ((pas=9) and(modul=1)) or((pas=6) and(modul=2)) or((pas=5) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(515,300,515,370);

line(515,370,505,370);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(515,300,515,370);

delay(25);

line(515,370,505,370);

delay(25);

setlinestyle(0,0,2);

end;

end;

if ((pas=10) and(modul=1)) or((pas=7) and(modul=2)) or((pas=5) and(modul=3)) then

begin

- 23 -

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(525,300,525,370);

line(525,370,535,370);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(525,300,525,370);

delay(25);

line(525,370,535,370);

delay(25);

setlinestyle(0,0,2);

end;

end;

end;

function genereaza; 

dir:Searchrec;

v:array[1..30]of string[12];

begin

if domeniu<>'RANDOM' then

domeniu:=domeniu+'.dmn'

else

begin

j:=1;

FindFirst('*.dmn',$3F, Dir);

v[j]:=dir.name;

while DosError = 0 do

begin

FindNext(Dir);

inc(j);

v[j]:=dir.name;

end;

randomize;

domeniu:=v[random(j)+1];

end;

assign(f,domeniu);

reset(f);

n:=0;

while not eof(f) do

begin readln(f,s);inc(n);end;

close(f);

randomize;

n:=random(n);

assign(f,domeniu);

reset(f);

for i:=1 to n+1 do

readln(f,s);

close(f);

genereaza:=s;

end;

procedure litere; 

v:array[1..26]of char;

q:boolean;

i,z:integer;

begin

setcolor(14);

setfillstyle(1,14);

bar3d(3,250,100,300,5,true);

setcolor(2);

- 24 -

settextstyle(1,0,4);

outtextxy(25,255,'> <');

setcolor(4);

outtextxy(45,255,c1);

i:=0;

for ch:='a' to 'z' do

begin inc(i);v[i]:=ch;end;

if pl=2 then

begin

setcolor(14);

bar3d(320,250,421,300,5,true);

setcolor(2);

settextstyle(1,0,4);

outtextxy(344,255,'> <');

setcolor(4);

outtextxy(364,255,c2);

end;

repeat

q:=false;

ch:=readkey;

if ch=cauta(5) then

begin

for i:=1 to 26 do

if v[i]=c1 then z:=i;

if z>1 then c1:=v[z-1]

else c1:=v[26];

setcolor(14);

setfillstyle(1,14);

bar3d(3,250,100,300,5,true);

setcolor(2);

settextstyle(1,0,4);

outtextxy(25,255,'> <');

setcolor(4);

outtextxy(45,255,c1);

end;

if ch=cauta(6) then

begin

for i:=1 to 26 do

if v[i]=c1 then z:=i;

if z<26 then c1:=v[z+1]

else c1:=v[1];

setcolor(14);

setfillstyle(1,14);

bar3d(3,250,100,300,5,true);

setcolor(2);

settextstyle(1,0,4);

outtextxy(25,255,'> <');

setcolor(4);

outtextxy(45,255,c1);

end;

if ch=cauta(7) then begin c:=c1;cine:=1;q:=true;end;

if pl=2 then

begin

if ch=cauta(9) then

begin

for i:=1 to 26 do

if v[i]=c2 then z:=i;

if z<26 then c2:=v[z+1]

else c2:=v[1];

setcolor(14);

bar3d(320,250,421,300,5,true);

setcolor(2);

settextstyle(1,0,4);

outtextxy(344,255,'> <');

setcolor(4);

outtextxy(364,255,c2);

end;

if ch=cauta(8) then

- 25 -

begin

for i:=1 to 26 do

if v[i]=c2 then z:=i;

if z>1 then c2:=v[z-1]

else c2:=v[26];

setcolor(14);

bar3d(320,250,421,300,5,true);

setcolor(2);

settextstyle(1,0,4);

outtextxy(344,255,'> <');

setcolor(4);

outtextxy(364,255,c2);

end;

if ch=cauta(10) then begin c:=c2;cine:=2;q:=true;end;

end;

until q;

end;

procedure spanzuratoarea; 

scor:=0; 

setcolor(1);

setfillstyle(1,1);

bar(1,1,640,480);

sond:=cauta(1);fast:=cauta(2); key:=cauta(3);domain:=cauta(4);

f1:=cauta(5);b1:=cauta(6); u1:=cauta(7);f2:=cauta(8); b2:=cauta(9);u2:=cauta(10);

val (cauta(12),x,cod);c_span:=x;val (cauta(13),x,cod);c_ata:=x;

val (cauta(14),x,cod);c_cap:=x;val (cauta(15),x,cod);c_ochi:=x;

val (cauta(16),x,cod);c_nas:=x;val (cauta(17),x,cod);c_gura:=x;

val (cauta(18),x,cod);c_gat:=x;val (cauta(19),x,cod);c_trunchi:=x;

val (cauta(20),x,cod);c_membre:=x;val (cauta(11),x,cod);c_fond:=x;

if fast='ON' then fast1:=0 else fast1:=1;

if op_mode=1 then

begin

closegraph; 

setcolor(1);

setfillstyle(1,1);

bar(1,1,640,480);

if op_mode=1 then a:=genereaza(domain);

if op_mode=2 then

begin

closegraph;

repeat

textbackground(1);

clrscr;

ww:=true;

textcolor(14);

write('CUVANTUL:');

- 26 -

textcolor(2);

i:=0;

j:=1;

repeat

cc:=readkey;

case cc of

#8:if i>=1 then

begin

delete(a,i,1);

gotoxy(9+i,j);writeln(' ');

dec(i);

gotoxy(9+i+1,j);

end;

#13: delay(10);

else if (i<=17) and(ord(cc)>=97) and(ord(cc)<=122) then

begin

inc(i);

insert(cc,a,i);

gotoxy(9+i,j);

writeln('*');

gotoxy(9+i+1,j);

end;

end;

until (cc=#13) and(i>3) and(i<17);

delete(a,i+1,256-i);

until ww;

dr:=detect;

initgraph(dr,mo,' ');

end;

cuvant(a,b);

fond(c_fond);

setcolor(14);

pas:=0;

spanzura(pas,fast1, op_dificulty, c_span, c_ata, c_cap, c_ochi, c_nas, c_gura, c_gat, c_trunchi, c_membre);

setcolor(15);

settextstyle(10,0,4);

outtextxy(1,1,b);

setcolor(13);

settextstyle(1,0,3);

outtextxy(10,100,'LITERA:');

setcolor(2);

setlinestyle(0,0,3);

rectangle(100,90,150,140);

setcolor(7);

settextstyle(2,0,5);

outtextxy(1,150,'LITERE FOLOSITE:');

c1:='a';c2:='a';

q:=false;

j:=0;

repeat

if key='OFF' then litere(c,cine,c1,c2,1)

else c:=readkey;

if sond='ON'then

begin

sound(850);

delay(100);

nosound;

end;

w:=false;

if (ord(c)>=97) and(ord(c)<=122) then w:=true;

if w then

begin

setcolor(4);

settextstyle(10,0,2);

outtextxy(115,85,c);

delay(100);

- 27 -

d:=b;

apar:=true;

for i:=1 to j do

if v[i]=c then apar:=false;

if (c=a[1]) or(c=a[length(a)]) then apar:=false;

if apar then

begin

inc(j);

v[j]:=c;

setcolor(7);

settextstyle(2,0,5);

outtextxy(j*10+110,150,c);

for i:=1 to length(a) do

if a[i]=c then b[i]:=c;

if d=b then inc(pas);

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(1,1,640,80);

setcolor(15);

settextstyle(10,0,4);

outtextxy(1,1,b);

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(102,92,148,138);

spanzura(pas,fast1, op_dificulty, c_span, c_ata, c_cap, c_ochi, c_nas, c_gura, c_gat, c_trunchi, c_membre);

if (a=b) or((pas=10) and(op_dificulty=1)) or((pas=7) and(op_dificulty=2)) or((pas=5) and(op_dificulty=3)) then q:=true;

if a=b then

begin

inc(scor);

if cauta(1)='ON'then

begin

sound(100);

delay(50);

sound(200);

delay(60);

sound(300);

delay(70);

sound(400);

delay(80);

sound(500);

delay(90);

sound(600);

delay(100);

nosound;

end;

end;

end

else

begin

setcolor(4);

settextstyle(4,0,2);

outtextxy(1,400,'Aceast† liter† a mai fost folosit† o dat† Œn cuvƒnt.');

delay(1000);

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(102,92,148,138);

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(1,400,500,430);

end;

end

else

begin

setcolor(4);

settextstyle(4,0,2);

outtextxy(1,400,'Aveti voie s† introduceti doar litere mici.');

delay(1000);

setcolor(c_fond);

- 28 -

setfillstyle(1, c_fond);

bar(102,92,148,138);

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(1,400,500,430);

end;

until q;

if a<>b then final:=true;

i:=0;

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(1,1,640,80);

if final then

begin

setcolor(4);

settextstyle(4,0,8);

outtextxy(1,300,'GAME OVER');

if cauta(1)='ON' then

begin

sound(700);

delay(50);

sound(200);

delay(500);

end;

repeat

inc(i);

setcolor(i);

settextstyle(10,0,4);

outtextxy(1,1,a);

delay(50);

until keypressed;

nosound;

c:=readkey;

if op_mode=1 then

begin

assign(f,'highscor.hsc');

append(f);

if IOResult<>0 then begin rewrite(f);end;

write(f,nume);write(f,'-------');write(f,scor);write(f,' cuvinte');write(f,'-------');

if op_dificulty=1 then write(f,'usor');

if op_dificulty=2 then write(f,'normal');

if op_dificulty=3 then write(f,'greu');

writeln(f);

close(f);

end;

end;

until final;

end;

procedure spanzura2;

begin

setcolor(15);

setlinestyle(0,0,3);

line(310,1,310,480);

setlinestyle(0,0,2);

x:=320;

if ((pas1=0) and(modul=1)) or((pas1=0) and((modul=2) or(modul=3))) then

begin

setcolor(c_span);

setfillstyle(1, c_span);

bar(600,100,620,470);

bar(600,100,500,130);

end;

- 29 -

if ((pas1=1) and(modul=3)) or((pas1=0) and((modul=2) or(modul=1))) then

begin

if fast=0 then

begin

setcolor(c_ata);

setlinestyle(0,0,3);

line(520,130,520,150);

line(520,150,510,180);

line(520,150,530,180);

arc(520,180,180,0,10);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_ata);

setlinestyle(0,0,3);

line(520,130,520,150);

delay(20);

line(520,150,510,180);

delay(20);

line(520,150,530,180);

delay(20);

arc(520,180,180,0,10);

delay(20);

setlinestyle(0,0,2);

end;

end;

if ((pas1=2) and(modul=3)) or((pas1=1) and((modul=2) or(modul=1))) then

begin

if fast=0 then

begin

setcolor(c_cap);

setfillstyle(1, c_cap);

pieslice(520,180,0,360,30);

end

else

begin

setcolor(c_cap);

setfillstyle(1, c_cap);

for i:=1 to 360 do

begin

pieslice(520,180,0,i,30);

delay(10);

end;

end;

end;

if ((pas1=2) and(modul=1)) or((pas1=2) and(modul=2)) or((pas1=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_ochi);

setfillstyle(1, c_ochi);

pieslice(505,170,0,360,5);

pieslice(535,170,0,360,5);

setcolor(1);

setfillstyle(1,1);

pieslice(505,172,0,360,3);

pieslice(535,172,0,360,3);

end

else

begin

setcolor(c_ochi);

setfillstyle(1, c_ochi);

pieslice(505,170,0,360,5);

delay(20);

- 30 -

pieslice(535,170,0,360,5);

delay(20);

setcolor(1);

setfillstyle(1,1);

pieslice(505,172,0,360,3);

delay(20);

pieslice(535,172,0,360,3);

delay(20);

end;

end;

if ((pas1=3) and(modul=1)) or((pas1=2) and(modul=2)) or((pas1=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_nas);

setlinestyle(0,0,3);

line(520,175,520,185);

line(520,185,515,189);

line(520,185,525,189);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_nas);

setlinestyle(0,0,3);

line(520,175,520,185);

delay(20);

line(520,185,515,189);

delay(20);

line(520,185,525,189);

delay(20);

setlinestyle(0,0,2);

end;

end;

if ((pas1=4) and(modul=1)) or((pas1=2) and(modul=2)) or((pas1=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_gura);

setlinestyle(0,0,3);

ellipse(520,190,180,360,15,10);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_gura);

setlinestyle(0,0,3);

for i:=181 to 360 do

begin

ellipse(520,190,180,i,15,10);

delay(10);

end;

setlinestyle(0,0,2);

end;

end;

if ((pas1=5) and(modul=1)) or((pas1=1) and(modul=2)) or((pas1=3) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_gat);

setlinestyle(0,0,3);

line(520,211,520,225);

line(518,211,518,225);

line(522,211,522,225);

- 31 -

setlinestyle(0,0,2);

end

else

begin

setcolor(c_gat);

setlinestyle(0,0,3);

for i:=212 to 225 do

begin

line(520,211,520,i);

line(518,211,518,i);

line(522,211,522,i);

delay(10);

end;

setlinestyle(0,0,2);

end;

end;

if ((pas1=6) and(modul=1)) or((pas1=3) and(modul=2)) or((pas1=3) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_trunchi);

setfillstyle(1, c_trunchi);

bar(500,225,540,300);

end

else

begin

setcolor(c_trunchi);

setfillstyle(1, c_trunchi);

for i:=226 to 300 do

begin

bar(500,225,540,i);

delay(10);

end;

end;

end;

if ((pas1=7) and(modul=1)) or((pas1=4) and(modul=2)) or((pas1=4) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(500,230,480,270);

line(480,270,474,265);

line(480,270,470,270);

line(480,270,470,276);

line(480,270,476,280);

line(480,270,483,278);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(500,230,480,270);

delay(15);

line(480,270,474,265);

delay(15);

line(480,270,470,270);

delay(15);

line(480,270,470,276);

delay(15);

line(480,270,476,280);

delay(15);

line(480,270,483,278);

setlinestyle(0,0,2);

end;

- 32 -

end;

if ((pas1=8) and(modul=1)) or((pas1=5) and(modul=2)) or((pas1=4) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(540,230,560,270);

line(560,270,566,265);

line(560,270,570,270);

line(560,270,570,276);

line(560,270,564,280);

line(560,270,557,278);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(540,230,560,270);

delay(15);

line(560,270,566,265);

delay(15);

line(560,270,570,270);

delay(15);

line(560,270,570,276);

delay(15);

line(560,270,564,280);

delay(15);

line(560,270,557,278);

setlinestyle(0,0,2);

end;

end;

if ((pas1=9) and(modul=1)) or((pas1=6) and(modul=2)) or((pas1=5) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(515,300,515,370);

line(515,370,505,370);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(515,300,515,370);

delay(25);

line(515,370,505,370);

delay(25);

setlinestyle(0,0,2);

end;

end;

if ((pas1=10) and(modul=1)) or((pas1=7) and(modul=2)) or((pas1=5) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(525,300,525,370);

line(525,370,535,370);

setlinestyle(0,0,2);

end

else

- 33 -

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(525,300,525,370);

delay(25);

line(525,370,535,370);

delay(25);

setlinestyle(0,0,2);

end;

end;

if ((pas2=0) and(modul=1)) or((pas2=0) and((modul=2) or(modul=3))) then

begin

setcolor(c_span);

setfillstyle(1, c_span);

bar(600-x,100,620-x,470);

bar(600-x,100,500-x,130);

end;

if ((pas2=1) and(modul=3)) or((pas2=0) and((modul=2) or(modul=1))) then

begin

if fast=0 then

begin

setcolor(c_ata);

setlinestyle(0,0,3);

line(520-x,130,520-x,150);

line(520-x,150,510-x,180);

line(520-x,150,530-x,180);

arc(520-x,180,180,0,10);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_ata);

setlinestyle(0,0,3);

line(520-x,130,520-x,150);

delay(20);

line(520-x,150,510-x,180);

delay(20);

line(520-x,150,530-x,180);

delay(20);

arc(520-x,180,180,0,10);

delay(20);

setlinestyle(0,0,2);

end;

end;

if ((pas2=2) and(modul=3)) or((pas2=1) and((modul=2) or(modul=1))) then

begin

if fast=0 then

begin

setcolor(c_cap);

setfillstyle(1, c_cap);

pieslice(520-x,180,0,360,30);

end

else

begin

setcolor(c_cap);

setfillstyle(1, c_cap);

for i:=1 to 360 do

begin

pieslice(520-x,180,0,i,30);

delay(10);

end;

end;

end;

if ((pas2=2) and(modul=1)) or((pas2=2) and(modul=2)) or((pas2=2) and(modul=3)) then

begin

- 34 -

if fast=0 then

begin

setcolor(c_ochi);

setfillstyle(1, c_ochi);

pieslice(505-x,170,0,360,5);

pieslice(535-x,170,0,360,5);

setcolor(1);

setfillstyle(1,1);

pieslice(505-x,172,0,360,3);

pieslice(535-x,172,0,360,3);

end

else

begin

setcolor(c_ochi);

setfillstyle(1, c_ochi);

pieslice(505-x,170,0,360,5);

delay(20);

pieslice(535-x,170,0,360,5);

delay(20);

setcolor(1);

setfillstyle(1,1);

pieslice(505-x,172,0,360,3);

delay(20);

pieslice(535-x,172,0,360,3);

delay(20);

end;

end;

if ((pas2=3) and(modul=1)) or((pas2=2) and(modul=2)) or((pas2=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_nas);

setlinestyle(0,0,3);

line(520-x,175,520-x,185);

line(520-x,185,515-x,189);

line(520-x,185,525-x,189);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_nas);

setlinestyle(0,0,3);

line(520-x,175,520-x,185);

delay(20);

line(520-x,185,515-x,189);

delay(20);

line(520-x,185,525-x,189);

delay(20);

setlinestyle(0,0,2);

end;

end;

if ((pas2=4) and(modul=1)) or((pas2=2) and(modul=2)) or((pas2=2) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_gura);

setlinestyle(0,0,3);

ellipse(520-x,190,180,360,15,10);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_gura);

setlinestyle(0,0,3);

for i:=181 to 360 do

- 35 -

begin

ellipse(520-x,190,180,i,15,10);

delay(10);

end;

setlinestyle(0,0,2);

end;

end;

if ((pas2=5) and(modul=1)) or((pas2=1) and(modul=2)) or((pas2=3) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_gat);

setlinestyle(0,0,3);

line(520-x,211,520-x,225);

line(518-x,211,518-x,225);

line(522-x,211,522-x,225);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_gat);

setlinestyle(0,0,3);

for i:=212 to 225 do

begin

line(520-x,211,520-x,i);

line(518-x,211,518-x,i);

line(522-x,211,522-x,i);

delay(10);

end;

setlinestyle(0,0,2);

end;

end;

if ((pas2=6) and(modul=1)) or((pas2=3) and(modul=2)) or((pas2=3) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_trunchi);

setfillstyle(1, c_trunchi);

bar(500-x,225,540-x,300);

end

else

begin

setcolor(c_trunchi);

setfillstyle(1, c_trunchi);

for i:=226 to 300 do

begin

bar(500-x,225,540-x,i);

delay(10);

end;

end;

end;

if ((pas2=7) and(modul=1)) or((pas2=4) and(modul=2)) or((pas2=4) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(500-x,230,480-x,270);

line(480-x,270,474-x,265);

line(480-x,270,470-x,270);

line(480-x,270,470-x,276);

line(480-x,270,476-x,280);

line(480-x,270,483-x,278);

setlinestyle(0,0,2);

end

- 36 -

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(500-x,230,480-x,270);

delay(15);

line(480-x,270,474-x,265);

delay(15);

line(480-x,270,470-x,270);

delay(15);

line(480-x,270,470-x,276);

delay(15);

line(480-x,270,476-x,280);

delay(15);

line(480-x,270,483-x,278);

setlinestyle(0,0,2);

end;

end;

if ((pas2=8) and(modul=1)) or((pas2=5) and(modul=2)) or((pas2=4) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(540-x,230,560-x,270);

line(560-x,270,566-x,265);

line(560-x,270,570-x,270);

line(560-x,270,570-x,276);

line(560-x,270,564-x,280);

line(560-x,270,557-x,278);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(540-x,230,560-x,270);

delay(15);

line(560-x,270,566-x,265);

delay(15);

line(560-x,270,570-x,270);

delay(15);

line(560-x,270,570-x,276);

delay(15);

line(560-x,270,564-x,280);

delay(15);

line(560-x,270,557-x,278);

setlinestyle(0,0,2);

end;

end;

if ((pas2=9) and(modul=1)) or((pas2=6) and(modul=2)) or((pas2=5) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(515-x,300,515-x,370);

line(515-x,370,505-x,370);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(515-x,300,515-x,370);

delay(25);

- 37 -

line(515-x,370,505-x,370);

delay(25);

setlinestyle(0,0,2);

end;

end;

if ((pas2=10) and(modul=1)) or((pas2=7) and(modul=2)) or((pas2=5) and(modul=3)) then

begin

if fast=0 then

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(525-x,300,525-x,370);

line(525-x,370,535-x,370);

setlinestyle(0,0,2);

end

else

begin

setcolor(c_membre);

setlinestyle(0,0,3);

line(525-x,300,525-x,370);

delay(25);

line(525-x,370,535-x,370);

delay(25);

setlinestyle(0,0,2);

end;

end;

end;

procedure fond1; 

setcolor(bk);

setfillstyle(1,bk);

bar(1,1,309,480);

end;

procedure fond2; 

setcolor(bk);

setfillstyle(1,bk);

bar(311,1,640,480);

end;

procedure spanzuratoarea2; 

j,i,cine,fast1,pas1,pas2,dr,mo,cod,x,y, c_fond, c_span, c_ata, c_cap, c_ochi, c_nas, c_gura, c_gat, c_trunchi, c_membre:integer;

w,apar,final1,final2,q,ww:boolean;

v1,v2:array[1..30]of char;

a1,a2,a3,a4:array[1..50]of string[18];

kkk,kk,k,zz1,zz2,scor1,scor2,nr1,nr2,nr:integer;

sc1,sc2:string[2];

begin

setcolor(1);

setfillstyle(1,1);

bar(1,1,640,480);

sond:=cauta(1);fast:=cauta(2); key:=cauta(3);domain:=cauta(4);

f1:=cauta(5);b1:=cauta(6); u1:=cauta(7);f2:=cauta(8); b2:=cauta(9);u2:=cauta(10);

val (cauta(12),x,cod);c_span:=x;val (cauta(13),x,cod);c_ata:=x;

val (cauta(14),x,cod);c_cap:=x;val (cauta(15),x,cod);c_ochi:=x;

val (cauta(16),x,cod);c_nas:=x;val (cauta(17),x,cod);c_gura:=x;

val (cauta(18),x,cod);c_gat:=x;val (cauta(19),x,cod);c_trunchi:=x;

val (cauta(20),x,cod);c_membre:=x;val (cauta(11),x,cod);c_fond:=x;

if fast='ON' then fast1:=0 else fast1:=1;

closegraph;

repeat

textmode(1);

textbackground(1);

- 38 -

clrscr;

textcolor(14);

write('Introduceti num†rul de cuvinte:');

textcolor(2);

readln(nr);

until (IOResult=0) and(nr>=1) and(nr<=50);

textmode(10);

if op_mode=1 then

begin

textcolor(4);

gotoxy(1,7);writeln('Genereaz† cuvinte pentru juc†torul 1');

textcolor(14);

gotoxy(1,8);writeln(' Ü ');

gotoxy(1,9);writeln('Ý  T');

gotoxy(1,10);writeln(' ß ß ß ß ß ß ß ß ß ß ');

randomize;

for i:=1 to nr do

begin randomize;a1[i]:=genereaza(domain); cuvant(a1[i],b);a3[i]:=b;gotoxy(2,9);writeln('T');

if i<=39 then begin gotoxy(i*2-1,9);writeln('ÛÛ');end;delay(50);end;

for i:=nr*2 to 78 do

begin

gotoxy(i,9);writeln('Û');delay(40);

end;

gotoxy(79,9);writeln('Ý');

textcolor(4);

gotoxy(1,13);writeln('Genereaz† cuvinte pentru juc†torul 2');

textcolor(14);

gotoxy(1,14);writeln(' Ü ');

gotoxy(1,15);writeln('Ý T');

gotoxy(1,16);writeln(' ß ß ß ß ß ß ß ß ß ß ');

for i:=1 to nr do

begin randomize;a2[i]:=genereaza(domain); cuvant(a2[i],bb);a4[i]:=bb;gotoxy(2,15);writeln('T');

if i<=39 then begin gotoxy(i*2-1,15);writeln('ÛÛ');end;delay(50);end;

for i:=nr*2 to 78 do

begin

gotoxy(i,15);writeln('Û');delay(40);

end;

gotoxy(79,15);writeln('Ý');

dr:=detect;

initgraph(dr,mo,' ');

end;

if op_mode=2 then

begin

closegraph;

textbackground(1);

clrscr;

textcolor(4);

writeln(' PLAYER1');

kkk:=2;

for i:=1 to nr do

repeat

ww:=true;

textcolor(14);

gotoxy(1,kkk);write('CUVANTUL nr.',i,':');

textcolor(2);

kk:=0;

gotoxy(16,kkk);

repeat

cc:=readkey;

case cc of

#8:if kk>=1 then

begin

delete(a2[i],kk,1);

gotoxy(15+kk,kkk);writeln(' ');

dec(kk);

gotoxy(15+kk+1,kkk);

- 39 -

end;

#13: delay(10);

else if (kk<=17) and(ord(cc)>=97) and(ord(cc)<=122) then

begin

inc(kk);

insert(cc,a2[i],kk);

gotoxy(15+kk,kkk);

writeln('*');

gotoxy(15+kk+1,kkk);

end;

end;

until (cc=#13) and(kk>3) and(kk<17);

delete(a2[i],kk+1,256-kk);

cuvant(a2[i],bb);a4[i]:=bb;

inc(kkk);

until ww;

textbackground(1);

clrscr;

textcolor(4);

writeln(' PLAYER2');

kkk:=2;

for i:=1 to nr do

repeat

ww:=true;

textcolor(14);

gotoxy(1,kkk);writeln('CUVANTUL nr.',i,':');

textcolor(2);

kk:=0;

gotoxy(16,kkk);

repeat

cc:=readkey;

case cc of

#8:if kk>=1 then

begin

delete(a1[i],kk,1);

gotoxy(15+kk,kkk);writeln(' ');

dec(kk);

gotoxy(15+kk+1,kkk);

end;

#13: delay(10);

else if (kk<=17) and(ord(cc)>=97) and(ord(cc)<=122) then

begin

inc(kk);

insert(cc,a1[i],kk);

gotoxy(15+kk,kkk);

writeln('*');

gotoxy(15+kk+1,kkk);

end;

end;

until (cc=#13) and(kk>3) and(kk<17);

delete(a1[i],kk+1,256-kk);

cuvant(a1[i],b);a3[i]:=b;

inc(kkk);

until ww;

dr:=detect;

initgraph(dr,mo,' ');

end;

final1:=true;final2:=true;

nr1:=0;nr2:=0;scor1:=0;scor2:=0;

c1:='a';c2:='a';

repeat

if final1 then begin pas2:=0;fond1(c_fond);inc(nr1);final1:=false; cuvant(a1[nr1],b);x:=2;v1[1]:=a1[nr1][1];

v1[2]:=a1[nr1][length(a1[nr1])];

end;

if final2 then begin pas1:=0;fond2(c_fond);inc(nr2);final2:=false; cuvant(a2[nr2],bb);y:=2;v2[1]:=a2[nr2][1];

v2[2]:=a2[nr2][length(a2[nr2])];

end;

spanzura2(pas1,pas2,fast1, op_dificulty, c_span, c_ata, c_cap, c_ochi, c_nas, c_gura, c_gat, c_trunchi, c_membre);

- 40 -

setcolor(c_fond);

setfillstyle(1, c_fond);

bar(1,1,308,100); bar(312,1,640,100);

setcolor(13);

settextstyle(2,0,4);

outtextxy(1,80,'LITERE FOLOSITE:'); outtextxy(312,80,'LITERE FOLOSITE:');

setcolor(6);

settextstyle(2,0,4);

for i:=1 to x do outtextxy(i*10+85,80,v1[i]);

for i:=1 to y do outtextxy(i*10+396,80,v2[i]);

setcolor(15);

settextstyle(10,0,2);

outtextxy(1,1,b); outtextxy(312,1,bb);

cine:=0;

if (nr1<>nr+1) and(nr2<>nr+1)then

begin

litere(c,cine,c1,c2,2);

if sond='ON'then

begin

sound(850);

delay(100);

nosound;

end;

end;

apar:=true;

if cine=1 then

begin

for i:=1 to x do

if v1[i]=c then begin zz1:=i;apar:=false;end;

if apar then

begin

inc(x);v1[x]:=c;

q:=false;

for i:=2 to length(a1[nr1])-1 do

if a1[nr1][i]=c then begin q:=true;b[i]:=c;end;

if not q then inc(pas2);

end

else begin setcolor(10);

if cauta(1)='ON' then sound(200);

for k:=1 to 360 do

begin arc(zz1*10+88,86,0,k,7);delay(2);end;

nosound;

end;

end;

apar:=true;

if cine=2 then

begin

for i:=1 to y do

if v2[i]=c then begin zz2:=i;apar:=false;end;

if apar then

begin

inc(y);v2[y]:=c;

q:=false;

for i:=2 to length(a2[nr2])-1 do

if a2[nr2][i]=c then begin q:=true;bb[i]:=c;end;

if not q then inc(pas1);

end

else begin setcolor(11);

if cauta(1)='ON' then sound(200);

for k:=1 to 360 do

begin arc(zz2*10+399,86,0,k,7);delay(2);end;

nosound;

end;

end;

if ((pas2=10) and(op_dificulty=1)) or((pas2=7) and(op_dificulty=2)) or((pas2=5) and(op_dificulty=3)) then

begin

final1:=true;

if cauta(1)='ON' then

- 41 -

begin

sound(700);

delay(50);

sound(200);

delay(500);

nosound;

end;

end;

if ((pas1=10) and(op_dificulty=1)) or((pas1=7) and(op_dificulty=2)) or((pas1=5) and(op_dificulty=3)) then

begin

final2:=true;

if cauta(1)='ON' then

begin

sound(700);

delay(50);

sound(200);

delay(500);

nosound;

end;

end;

if a1[nr1]=b then begin

inc(scor1);final1:=true;

if cauta(1)='ON' then

begin

sound(100);

delay(50);

sound(200);

delay(60);

sound(300);

delay(70);

sound(400);

delay(80);

sound(500);

delay(90);

sound(600);

delay(100);

nosound;

end;

end;

if a2[nr2]=bb then begin

inc(scor2);final2:=true;

if cauta(1)='ON' then

begin

sound(100);

delay(50);

sound(200);

delay(60);

sound(300);

delay(70);

sound(400);

delay(80);

sound(500);

delay(90);

sound(600);

delay(100);

nosound;

end;

end;

a3[nr1]:=b;a4[nr2]:=bb;

until (nr1=nr+1) or(nr2=nr+1);

fond(8);

setcolor(11);

setlinestyle(0,0,3);line(1,240,639,240); setlinestyle(0,0,2);

setcolor(10); settextstyle(10,0,4);

if scor1>scor2 then

begin

outtextxy(50,1,'Juc†tor1-->Cƒstig†tor');

outtextxy(50,250,'Juc†tor2-->Pierz†tor');

- 42 -

end;

if scor1<scor2 then

begin

outtextxy(50,1,'Juc†tor1-->Pierz†tor');

outtextxy(50,250,'Juc†tor2-->Cƒstig†tor');

end;

if scor1=scor2 then

begin

outtextxy(50,1,'Juc†tor1-->Pierz†tor');

outtextxy(50,250,'Juc†tor2-->Pierz†tor');

end;

str(scor1,sc1);str(scor2,sc2);

setcolor(0); settextstyle(0,0,7);

outtextxy(150,150,sc1);

outtextxy(150,400,sc2);

setcolor(0); settextstyle(3,0,5);

if length(sc1)=1 then outtextxy(210,150,'-cuvinte')

else outtextxy(260,150,'-cuvinte');

if length(sc2)=1 then outtextxy(210,400,'-cuvinte')

else outtextxy(260,400,'-cuvinte');

i:=0;

settextstyle(1,0,2);

repeat

repeat

inc(i);

setcolor(i);

if scor1>scor2 then outtextxy(150,80,'Felicit†ri OMULE! Eshty chiar BAROSAN')

else outtextxy(150,80,'FRAIERE! Eshty un RATAT.');

if scor1<scor2 then outtextxy(150,330,'Felicit†ri OMULE! Eshty chiar BAROSAN')

else outtextxy(150,330,'FRAIERE! Eshty un RATAT.');

until keypressed;

c:=readkey;

until c=#13;

closegraph;

textbackground(1);

clrscr;

textcolor(4);

writeln('  PLAYER 1 PLAYER 2');

textcolor(2);

for i:=1 to nr do

writeln(' ',a1[i],':',a3[i]);

for i:=1 to nr do

begin

gotoxy(40,i+1);writeln(' ',a2[i],':',a4[i]);

end;

readln;

dr:=detect;

initgraph(dr,mo,' ');

end;

procedure help;

v:array[1..10]of string;

i,j:integer;

a:array[1..10]of integer;

c:char;

begin

setcolor(0);

setfillstyle(1,0);

bar(1,1,640,480);

settextstyle(1,0,10);

j:=150;

for i:=1 to 10 do

begin

setcolor(0);

outtextxy(1+(i-1)*10,j,'R');

outtextxy(640-(i-1)*15,j,'A');

setcolor(10);

- 43 -

outtextxy(1+i*10,j,'R');

outtextxy(640-i*15,j,'A');

delay(100);

end;

i:=260;

for j:=1 to 15 do

begin

setcolor(0);

outtextxy(i,1+(j-1)*10,'X');

outtextxy(i+80,450-(j-1)*20,'A');

setcolor(10);

outtextxy(i,1+j*10,'X');

outtextxy(i+80,450-j*20,'A');

delay(100);

end;

delay(300);

outtextxy(180,150,'O');

outtextxy(420,150,'N');

s:='ROXANA';

setcolor(0);

setfillstyle(1,0);

bar(100,150,550,300);

i:=100;

for j:=15 downto -4 do

begin

setcolor(0);

outtextxy(i,1+(j+1)*10,s);

setcolor(10);

outtextxy(i,1+j*10,s);

delay(100);

end;

v[1]:='La realizarea acestui joc au contribuit:';

v[2]:='';

v[3]:='Programare  STANCU ROXANA';

v[4]:='Muzic† si sunet STANCU ROXANA';

v[5]:='Grafic† si animatie STANCU ROXANA';

v[6]:='Crearea domeniilor STANCU ROXANA';

v[7]:='Textele STANCU ROXANA';

v[8]:='Verificarea jocului STANCU ROXANA';

v[9]:='Scanarea de virusi STANCU ROXANA';

v[10]:='Creator STANCU IOANA ROXANA';

a[1]:=460;

for i:=2 to 10 do a[i]:=a[i-1]+25;

settextstyle(1,0,1);

repeat

repeat

setcolor(0);

for i:=1 to 10 do

outtextxy(50,a[i],v[i]);

for i:=1 to 10 do a[i]:=a[i]-5;

for i:=1 to 10 do

if a[i]=100 then a[i]:=710;

setcolor(15);

for i:=1 to 10 do

outtextxy(50,a[i],v[i]);

delay(200);

until keypressed;

c:=readkey;

until c=#13;

setcolor(0);

setfillstyle(1,0);

bar(1,1,640,480);

settextstyle(8,1,6);

setcolor(8); outtextxy(1,1,'Spƒnzur†toarea');

settextstyle(8,1,7);

setcolor(2); outtextxy(80,1,'by  ');

setcolor(4); outtextxy(180,1,'STANCU ');

setcolor(14); outtextxy(260,1,'IOANA ');

- 44 -

setcolor(1); outtextxy(340,1,'ROXANA ');

readln;

end;

BEGIN

END.

program JOCUL;

uses graph,crt,grafica,prog;

var i,dr,mo,pas, op, op_player, op_mode, op_dificulty, op_option,fast:integer;

s,a,b:string;

f:text;

q:boolean;

BEGIN

q:=true;

getdir(0,s);

chdir(s);

assign(f,'grafica.pas');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'prog.pas');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'settings.cfg');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'egavga.bgi');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'trip.chr');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'bold.chr');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'goth.chr');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'lcom.chr');

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

assign(f,'litt.chr');

- 45 -

Reset(F);

if IOResult <> 0 then q:=false

else close(f);

if not q then begin writeln('EROARE!Unul din fisierele jocului a fost sters.');

writeln('V† rog instalati jocul din nou.');readln;exit;end;

dr:=detect;

initgraph(dr,mo,' ');

repeat

main_menu('JOACA','OPTIUNI','SCORURI',' INFO','IESIRE', op);

if op=1 then

repeat

op_player:=3;

op_mode:=3;

op_dificulty:=0;

menu('JOACA','1Juc†tor','2Juc†tori','Œnapoi', op_player);

if (op_player=2) or(op_player=1) then

menu('Selecteaz† modul','MODUL 1','MODUL 2','Œnapoi', op_mode);

if op_mode<>3 then menu('DIFICULTATEA','Usor','Normal','Dificil', op_dificulty);

if op_dificulty<>0 then

begin

if op_player=1 then

spanzuratoarea(op_mode, op_dificulty);

if op_player=2 then spanzuratoarea2(op_mode, op_dificulty);

end;

until op_player=3;

if op=2 then option(op_option);

if op=3 then highscore;

if op=4 then help;

until op=5;

closegraph;

END.

Programul principal – JOCUL – este programul din care se apeleaza toate functiile si procedurile,acesta incarca unit-urile GRAFICA si PROG.

Programul cauta toate fisierele din joc, adica: grafica.pas, prog.pas; settings.chg, egava.bgi, trip.chr, bold.chr, goth.chr,ecom.chr, litt.chr;daca un fisier nu a fost gasit se afiseaza mesajul de eroare si se iese din joc cu procedura exit, iar daca se gasesc toate fisierele se apeleaza main_menu si apoi celelalte meniuri in functie de optiunea aleasa.

Motivatie

Majoritatea persoanelor cunosc jocul Spanzuratoarea,deoarece este un joc distractive si antrenant pentru mintile noastre,deaceea mi-am propus sa imi fac singura acest joculet,asa cum arata in viziunea mea.

Bibliografie

Manualul de Informatica - Editura NICULESCU pentru clasele 9, 10 si 11.

Help Pascal





Politica de confidentialitate





Copyright © 2024 - Toate drepturile rezervate