program Oan_tu_ti;
uses crt;
var chon : array[1..3] of string =('keo','bua','bao');
hinhphat: array[1..5] of string =('Bung tai','Nheo tay','Danh dau goi','Vo bap dui','Bung mui');
m, a,b,i,j,k,s,y,p1,p2:integer;
name1,name2:string;
procedure phat;
begin
clrscr;
a:=random(4)+1;
writeln('Nhan Enter de bat dau quay hinh phat');
readln;
clrscr;
randomize;
for i:=1 to 10 do begin
for m:=1 to 5 do begin
writeln(hinhphat[m]);
delay(50);
clrscr;
end;
end;
writeln('Hinh phat la : ',hinhphat[a]);
delay(1500);
writeln('Nhan Enter de quay so lan thuc hien');
readln;
randomize;
b:=random(4)+1;
for j:=1 to 10 do begin
for k:=1 to 5 do begin
writeln(k);
delay(50);
clrscr;
end;
end;
writeln('So lan thuc hien la : ',b);
readln;
end;
begin
clrscr;
textbackground(white);
textcolor(blue);
writeln('Xin chao!');
delay(2000);
writeln('Ban se choi oan tu ti voi nhau!!!');
delay(2000);
writeln('Phe nao duoc 5 diem truoc se chien thang!!!');
delay(2000);
writeln('Ai thua se bi chiu hinh phat!!!');
delay(2000);
writeln('CHUC BAN CHOI GAME VUI VE!!!');
delay(2000);
writeln('Nhan Enter de choi!!!');
readln;
clrscr;
write('Moi nhap ten Nguoi choi 1: '); readln(name1);
write('Moi nhap ten Nguoi choi 2: '); readln(name2);
s:=0;
y:=0;
repeat begin
clrscr;
randomize;
textcolor(1);
writeln(upcase(name1), ' chon gi?');
writeln('1: keo');
writeln('2: bua');
writeln('3: bao');
readln(p1);
clrscr;
writeln(upcase(name2), ' chon gi?');
writeln('1: keo');
writeln('2: bua');
writeln('3: bao');
readln(p2);
clrscr;
writeln('DE XEM NAO!!!');
readln;
clrscr;
writeln('A!!! Biet roi!!!');
delay(2000);
if p1=p2 then begin
writeln(upcase(name1),' chon ',chon[p1],' ||| ',upcase(name2),' chon ',chon[p2]);
delay(1000);
writeln('HOA!!!');
readln;
clrscr;
s:=s+1; y:=y+1;
writeln('Ti so: ',upcase(name1),' : ',s-1,' ',upcase(name2),' : ',y-1);
delay(1000);
clrscr;
writeln('Ti so: ',upcase(name1),' : ',s,' ',upcase(name2),' : ',y);
delay(1000);
writeln('Khong ai phai chiu phat!!!');
delay(1500);
writeln('Nhan Enter de tiep tuc');
readln;
end;
clrscr;
if((p1=1) and (p2=3)) or ((p1=2) and (p2=1)) or ((p1=3) and (p2=2)) then begin
writeln(upcase(name1),' chon ',chon[p1],' ||| ',upcase(name2),' chon ',chon[p2]);
delay(1000);
writeln(upcase(name1),' THANG!!!');
readln;
clrscr;
s:=s+1; y:=y;
writeln('Ti so: ',upcase(name1),' : ',s-1,' ',upcase(name2),' : ',y);
delay(1000);
clrscr;
writeln('Ti so: ',upcase(name1),' : ',s,' ',upcase(name2),' : ',y);
delay(1000);
writeln('Nhan Enter de tiep tuc');
readln;
clrscr;
phat;
end;
if((p2=1) and (p1=3)) or ((p2=2) and (p1=1)) or ((p2=3) and (p1=2)) then begin
writeln(upcase(name1),' chon ',chon[p1],' ||| ',upcase(name2),' chon ',chon[p2]);
delay(1000);
writeln(upcase(name2),' THANG!!!');
readln;
clrscr;
s:=s; y:=y+1;
writeln('Ti so: ',upcase(name1),' : ',s,' ',upcase(name2),' : ',y-1);
delay(1000);
clrscr;
writeln('Ti so: ',upcase(name1),' : ',s,' ',upcase(name2),' : ',y);
delay(1000);
writeln('Nhan Enter de tiep tuc');
readln;
phat;
end;
end;
until (s=10) or (y=10);
if s=10 then begin
clrscr;
writeln('CHUC MUNG!!! ',upcase(name1),' DA DANH BAI ',upcase(name2),'!!!');
readln;
end
else if y=10 then begin
clrscr;
writeln('CHUC MUNG!!! ',upcase(name2),' DA DANH BAI ',upcase(name1),'!!!');
readln;
end else
clrscr;
writeln('HAI BAN NGANG TAI NGANG SUC!!!');
readln;
clrscr;
for i:=10 downto 1 do begin
writeln('Chuong trinh se ket thuc sau:',i:2);
delay(1000);
clrscr;
end;
writeln('Tac gia: NGUYEN DANG KHOI');
readln;
end.
Mình cũng làm dc 1 chương trình update từ ct của bạn Lục Vân Tiên. Mấy bạn chơi cho mình ý kiến