Tin học Game flappy bird pascal

Huỳnh Văn Nguyên Phúc

Học sinh
Thành viên
24 Tháng mười 2020
5
9
21
17
Thừa Thiên Huế
Trương THCS Vinh Thanh
[TẶNG BẠN] TRỌN BỘ Bí kíp học tốt 08 môn
Chắc suất Đại học top - Giữ chỗ ngay!!

ĐĂNG BÀI NGAY để cùng trao đổi với các thành viên siêu nhiệt tình & dễ thương trên diễn đàn.

mình mất cả buổi tối mới làm được game này...
code:
program flappy_bird;
uses crt;
var a,b,c,d:integer;
var e,f,g,h:integer;
var j,k,x,y:integer;
var z,u,i,o:integer;
var p,q,r,n,m:integer;
var v,w,t,l:integer;
var ketthuc,rd:integer;
var tttime,ttkey,diem:integer;
var ch :char;
begin
clrscr;
writeln('so 6 la ong tre;so 1 la noi trong;so 8 la nhan vat;');
writeln('cach choi: nhan phim sang trai de di chuyen nhan vat');
writeln('game duoc lap trinh boi phuc');
writeln('nhan enter de tiep tuc');
readln;
diem:=0;
tttime:=4;
ttkey:=0;
ketthuc:=0;
a:=1;
b:=1;
c:=1;
d:=1;
e:=1;
f:=1;
g:=1;
h:=1;
j:=1;
k:=1;
x:=1;
y:=1;
z:=1;
u:=1;
i:=1;
o:=1;
p:=1;
q:=1;
r:=1;
n:=1;
m:=1;
v:=1;
w:=1;
t:=1;
l:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
repeat
rd:=random(4);
if (rd=0) then begin
e:=1;
k:=1;
i:=6;
n:=6;
l:=6;
end;
if (rd=1) then begin
e:=6;
k:=1;
i:=1;
n:=6;
l:=6;
end;
if (rd=2) then begin
e:=6;
k:=6;
i:=1;
n:=1;
l:=6;
end;
if (rd=3) then begin
e:=6;
k:=6;
i:=6;
n:=1;
l:=1;
end;
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
e:=1;
k:=1;
i:=1;
n:=1;
l:=1;
if (rd=0) then begin
d:=1;
j:=1;
u:=6;
r:=6;
t:=6;
end;
if (rd=1) then begin
d:=6;
j:=1;
u:=1;
r:=6;
t:=6;
end;
if (rd=2) then begin
d:=6;
j:=6;
u:=1;
r:=1;
t:=6;
end;
if (rd=3) then begin
d:=6;
j:=6;
u:=6;
r:=1;
t:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
d:=1;
j:=1;
u:=1;
r:=1;
t:=1;
if (rd=0) then begin
c:=1;
h:=1;
z:=6;
q:=6;
w:=6;
end;
if (rd=1) then begin
c:=6;
h:=1;
z:=1;
q:=6;
w:=6;
end;
if (rd=2) then begin
c:=6;
h:=6;
z:=1;
q:=1;
w:=6;
end;
if (rd=3) then begin
c:=6;
h:=6;
z:=6;
q:=1;
w:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
c:=1;
h:=1;
z:=1;
q:=1;
w:=1;
if (rd=0) then begin
if (tttime=1) then begin
b:=1;
g:=1;
y:=6;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=6;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=6;
v:=6;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=6;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=6;
p:=6;
v:=6;
end;
end;
if (rd=1) then begin
if (tttime=1) then begin
b:=6;
g:=1;
y:=1;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=1;
y:=1;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=6;
g:=1;
y:=8;
p:=6;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=6;
v:=6;
ketthuc:=1;
end;
end;
if (rd=2) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=1;
p:=1;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=1;
p:=8;
v:=6;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
end;
if (rd=3) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=6;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=6;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
diem:=diem+1;
if (ketthuc=0) then begin
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
if (rd=0) then begin
a:=1;
f:=1;
x:=6;
o:=6;
m:=6;
end;
if (rd=1) then begin
a:=6;
f:=1;
x:=1;
o:=6;
m:=6;
end;
if (rd=2) then begin
a:=6;
f:=6;
x:=1;
o:=1;
m:=6;
end;
if (rd=3) then begin
a:=6;
f:=6;
x:=6;
o:=1;
m:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
a:=1;
f:=1;
x:=1;
o:=1;
m:=1;
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
end;
until ketthuc=1;
writeln('game over');
writeln('game duoc lap trinh boi phuc');
readln;
end.
 

anhkhanh1411

Học sinh chăm học
Thành viên
17 Tháng sáu 2018
82
64
71
Bình Phước
THPT chuyên Hà Nội - Amsterdam
cái j vậy bạn? Dùng ntn? Mà game này chơi có hay ko?
 

anhkhanh1411

Học sinh chăm học
Thành viên
17 Tháng sáu 2018
82
64
71
Bình Phước
THPT chuyên Hà Nội - Amsterdam
nhưng mà dùng như thế nào ấy bạn? Mình thấy toàn code. Insert vào mấy cái phần mềm chạy code à?
 

Thần Lùn Giữ Của

Học sinh
Thành viên
14 Tháng ba 2020
12
7
31
17
Quảng Ninh
THCS Chu Văn An
Mình muốn góp ý là game màn hình hơi nhỏ, cái ống rất khó chui qua (hoặc do mình mắt kém), khó phân biệt ống với chỗ trống.
Nhưng mà làm thế là hay lắm rồi, mình còn không biết làm kìa...
 

Huỳnh Văn Nguyên Phúc

Học sinh
Thành viên
24 Tháng mười 2020
5
9
21
17
Thừa Thiên Huế
Trương THCS Vinh Thanh
nhưng mà dùng như thế nào ấy bạn? Mình thấy toàn code. Insert vào mấy cái phần mềm chạy code à?
đồ họa của game đc làm bằng số,
số 6 là ống tre, số 1 là khoảng trống,số 8 là nhân vật (con chim)
bạn phải nhấn phím sang trái để di chuyển nhân vật(con chim)
chúc bạn chơi game vui vẻ

Mình muốn góp ý là game màn hình hơi nhỏ, cái ống rất khó chui qua (hoặc do mình mắt kém), khó phân biệt ống với chỗ trống.
Nhưng mà làm thế là hay lắm rồi, mình còn không biết làm kìa...
cảm ơn bạn đã chơi game của mình, bạn quá khen vì trình độ của mình vẫn còn thấp lắm,cần phải học hỏi thêm bn à

nhưng mà dùng như thế nào ấy bạn? Mình thấy toàn code. Insert vào mấy cái phần mềm chạy code à?
cái này là code pascal nhé
 
Last edited by a moderator:

Hoang P

Học sinh
Thành viên
3 Tháng mười 2020
150
164
46
Hưng Yên
Hưng Yên
THPT Yên Mỹ
1. game khó chơi, khó điều khiển (quá nhiều số) tuy nhiên vì bạn đã tốn nhiều thời gian làm cái này nên cho bạn 1 like
2. thay vì dùng pascal, bạn có thể dùng scratch (dễ lập trình, nhiều icon) vì thế bạn có thể tham khảo
 

danglong3bkq

Học sinh
Thành viên
31 Tháng ba 2016
22
5
46
mình mất cả buổi tối mới làm được game này...
code:
program flappy_bird;
uses crt;
var a,b,c,d:integer;
var e,f,g,h:integer;
var j,k,x,y:integer;
var z,u,i,o:integer;
var p,q,r,n,m:integer;
var v,w,t,l:integer;
var ketthuc,rd:integer;
var tttime,ttkey,diem:integer;
var ch :char;
begin
clrscr;
writeln('so 6 la ong tre;so 1 la noi trong;so 8 la nhan vat;');
writeln('cach choi: nhan phim sang trai de di chuyen nhan vat');
writeln('game duoc lap trinh boi phuc');
writeln('nhan enter de tiep tuc');
readln;
diem:=0;
tttime:=4;
ttkey:=0;
ketthuc:=0;
a:=1;
b:=1;
c:=1;
d:=1;
e:=1;
f:=1;
g:=1;
h:=1;
j:=1;
k:=1;
x:=1;
y:=1;
z:=1;
u:=1;
i:=1;
o:=1;
p:=1;
q:=1;
r:=1;
n:=1;
m:=1;
v:=1;
w:=1;
t:=1;
l:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
repeat
rd:=random(4);
if (rd=0) then begin
e:=1;
k:=1;
i:=6;
n:=6;
l:=6;
end;
if (rd=1) then begin
e:=6;
k:=1;
i:=1;
n:=6;
l:=6;
end;
if (rd=2) then begin
e:=6;
k:=6;
i:=1;
n:=1;
l:=6;
end;
if (rd=3) then begin
e:=6;
k:=6;
i:=6;
n:=1;
l:=1;
end;
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
e:=1;
k:=1;
i:=1;
n:=1;
l:=1;
if (rd=0) then begin
d:=1;
j:=1;
u:=6;
r:=6;
t:=6;
end;
if (rd=1) then begin
d:=6;
j:=1;
u:=1;
r:=6;
t:=6;
end;
if (rd=2) then begin
d:=6;
j:=6;
u:=1;
r:=1;
t:=6;
end;
if (rd=3) then begin
d:=6;
j:=6;
u:=6;
r:=1;
t:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
d:=1;
j:=1;
u:=1;
r:=1;
t:=1;
if (rd=0) then begin
c:=1;
h:=1;
z:=6;
q:=6;
w:=6;
end;
if (rd=1) then begin
c:=6;
h:=1;
z:=1;
q:=6;
w:=6;
end;
if (rd=2) then begin
c:=6;
h:=6;
z:=1;
q:=1;
w:=6;
end;
if (rd=3) then begin
c:=6;
h:=6;
z:=6;
q:=1;
w:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
c:=1;
h:=1;
z:=1;
q:=1;
w:=1;
if (rd=0) then begin
if (tttime=1) then begin
b:=1;
g:=1;
y:=6;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=6;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=6;
v:=6;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=6;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=6;
p:=6;
v:=6;
end;
end;
if (rd=1) then begin
if (tttime=1) then begin
b:=6;
g:=1;
y:=1;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=1;
y:=1;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=6;
g:=1;
y:=8;
p:=6;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=6;
v:=6;
ketthuc:=1;
end;
end;
if (rd=2) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=1;
p:=1;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=1;
p:=8;
v:=6;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
end;
if (rd=3) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=6;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=6;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
diem:=diem+1;
if (ketthuc=0) then begin
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
if (rd=0) then begin
a:=1;
f:=1;
x:=6;
o:=6;
m:=6;
end;
if (rd=1) then begin
a:=6;
f:=1;
x:=1;
o:=6;
m:=6;
end;
if (rd=2) then begin
a:=6;
f:=6;
x:=1;
o:=1;
m:=6;
end;
if (rd=3) then begin
a:=6;
f:=6;
x:=6;
o:=1;
m:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
a:=1;
f:=1;
x:=1;
o:=1;
m:=1;
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
end;
until ketthuc=1;
writeln('game over');
writeln('game duoc lap trinh boi phuc');
readln;
end.
Tuy đồ họa không đẹp nhưng chơi cũng thấy hay và số điểm cao nhất của mình là 10.
 

Huỳnh Văn Nguyên Phúc

Học sinh
Thành viên
24 Tháng mười 2020
5
9
21
17
Thừa Thiên Huế
Trương THCS Vinh Thanh
mình mất cả buổi tối mới làm được game này...
mã số:
chương trình flappy_bird;
sử dụng crt;
var a,b,c,d:integer;
var e,f,g,h:integer;
var j,k,x,y:integer;
var z,u,i,o:integer;
var p,q,r,n,m:integer;
var v,w,t,l:số nguyên;
là ketthuc,rd:integer;
var tttime,ttkey,diem:integer;
var ch :char;
begin
clrscr;
writeln('so 6 la ong tre;so 1 la noi trong;so 8 la nhan vat;');
writeln('cach choi: nhan phim sang trai de di chuyen nhan vat');
writeln('game duoc lap trinh boi phuc');
writeln('nhan enter de tiep tuc');
readln;
diem:=0;
tttime:=4;
ttkey:=0;
ketthuc:=0;
a:=1;
b:=1;
c:=1;
d:=1;
e:=1;
f:=1;
g:=1;
h:=1;
j:=1;
k:=1;
x:=1;
y:=1;
z:=1;
u:=1;
i:=1;
o:=1;
p:=1;
q:=1;
r:=1;
n:=1;
m:=1;
v:=1;
w:=1;
t:=1;
l:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
repeat
rd:=random(4);
if (rd=0) then begin
e:=1;
k:=1;
i:=6;
n:=6;
l:=6;
end;
if (rd=1) then begin
e:=6;
k:=1;
i:=1;
n:=6;
l:=6;
end;
if (rd=2) then begin
e:=6;
k:=6;
i:=1;
n:=1;
l:=6;
end;
if (rd=3) then begin
e:=6;
k:=6;
i:=6;
n:=1;
l:=1;
end;
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
e:=1;
k:=1;
i:=1;
n:=1;
l:=1;
if (rd=0) then begin
d:=1;
j:=1;
u:=6;
r:=6;
t:=6;
end;
if (rd=1) then begin
d:=6;
j:=1;
u:=1;
r:=6;
t:=6;
end;
if (rd=2) then begin
d:=6;
j:=6;
u:=1;
r:=1;
t:=6;
end;
if (rd=3) then begin
d:=6;
j:=6;
u:=6;
r:=1;
t:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
d:=1;
j:=1;
u:=1;
r:=1;
t:=1;
if (rd=0) then begin
c:=1;
h:=1;
z:=6;
q:=6;
w:=6;
end;
if (rd=1) then begin
c:=6;
h:=1;
z:=1;
q:=6;
w:=6;
end;
if (rd=2) then begin
c:=6;
h:=6;
z:=1;
q:=1;
w:=6;
end;
if (rd=3) then begin
c:=6;
h:=6;
z:=6;
q:=1;
w:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
c:=1;
h:=1;
z:=1;
q:=1;
w:=1;
if (rd=0) then begin
if (tttime=1) then begin
b:=1;
g:=1;
y:=6;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=6;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=6;
v:=6;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=6;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=6;
p:=6;
v:=6;
end;
end;
if (rd=1) then begin
if (tttime=1) then begin
b:=6;
g:=1;
y:=1;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=1;
y:=1;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=6;
g:=1;
y:=8;
p:=6;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=6;
v:=6;
ketthuc:=1;
end;
end;
if (rd=2) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=1;
p:=1;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=1;
p:=8;
v:=6;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
end;
if (rd=3) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=6;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=6;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
diem:=diem+1;
if (ketthuc=0) then begin
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
if (rd=0) then begin
a:=1;
f:=1;
x:=6;
o:=6;
m:=6;
end;
if (rd=1) then begin
a:=6;
f:=1;
x:=1;
o:=6;
m:=6;
end;
if (rd=2) then begin
a:=6;
f:=6;
x:=1;
o:=1;
m:=6;
end;
if (rd=3) then begin
a:=6;
f:=6;
x:=6;
o:=1;
m:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
a:=1;
f:=1;
x:=1;
o:=1;
m:=1;
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
end;
until ketthuc=1;
writeln('game over');
writeln('game duoc lap trinh boi phuc');
readln;
mình mất cả buổi tối mới làm được game này...
code:
program flappy_bird;
uses crt;
var a,b,c,d:integer;
var e,f,g,h:integer;
var j,k,x,y:integer;
var z,u,i,o:integer;
var p,q,r,n,m:integer;
var v,w,t,l:integer;
var ketthuc,rd:integer;
var tttime,ttkey,diem:integer;
var ch :char;
begin
clrscr;
writeln('so 6 la ong tre;so 1 la noi trong;so 8 la nhan vat;');
writeln('cach choi: nhan phim sang trai de di chuyen nhan vat');
writeln('game duoc lap trinh boi phuc');
writeln('nhan enter de tiep tuc');
readln;
diem:=0;
tttime:=4;
ttkey:=0;
ketthuc:=0;
a:=1;
b:=1;
c:=1;
d:=1;
e:=1;
f:=1;
g:=1;
h:=1;
j:=1;
k:=1;
x:=1;
y:=1;
z:=1;
u:=1;
i:=1;
o:=1;
p:=1;
q:=1;
r:=1;
n:=1;
m:=1;
v:=1;
w:=1;
t:=1;
l:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
delay(600);
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
repeat
rd:=random(4);
if (rd=0) then begin
e:=1;
k:=1;
i:=6;
n:=6;
l:=6;
end;
if (rd=1) then begin
e:=6;
k:=1;
i:=1;
n:=6;
l:=6;
end;
if (rd=2) then begin
e:=6;
k:=6;
i:=1;
n:=1;
l:=6;
end;
if (rd=3) then begin
e:=6;
k:=6;
i:=6;
n:=1;
l:=1;
end;
clrscr;
writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
e:=1;
k:=1;
i:=1;
n:=1;
l:=1;
if (rd=0) then begin
d:=1;
j:=1;
u:=6;
r:=6;
t:=6;
end;
if (rd=1) then begin
d:=6;
j:=1;
u:=1;
r:=6;
t:=6;
end;
if (rd=2) then begin
d:=6;
j:=6;
u:=1;
r:=1;
t:=6;
end;
if (rd=3) then begin
d:=6;
j:=6;
u:=6;
r:=1;
t:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
d:=1;
j:=1;
u:=1;
r:=1;
t:=1;
if (rd=0) then begin
c:=1;
h:=1;
z:=6;
q:=6;
w:=6;
end;
if (rd=1) then begin
c:=6;
h:=1;
z:=1;
q:=6;
w:=6;
end;
if (rd=2) then begin
c:=6;
h:=6;
z:=1;
q:=1;
w:=6;
end;
if (rd=3) then begin
c:=6;
h:=6;
z:=6;
q:=1;
w:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
c:=1;
h:=1;
z:=1;
q:=1;
w:=1;
if (rd=0) then begin
if (tttime=1) then begin
b:=1;
g:=1;
y:=6;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=6;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=6;
v:=6;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=6;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=6;
p:=6;
v:=6;
end;
end;
if (rd=1) then begin
if (tttime=1) then begin
b:=6;
g:=1;
y:=1;
p:=6;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=1;
y:=1;
p:=8;
v:=6;
ketthuc:=1;
end;
if (tttime=3) then begin
b:=6;
g:=1;
y:=8;
p:=6;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=6;
v:=6;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=6;
v:=6;
ketthuc:=1;
end;
end;
if (rd=2) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=1;
p:=1;
v:=8;
ketthuc:=1;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=1;
p:=8;
v:=6;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=6;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=1;
p:=1;
v:=6;
ketthuc:=1;
end;
end;
if (rd=3) then begin
if (tttime=1) then begin
b:=6;
g:=6;
y:=6;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=6;
g:=6;
y:=6;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=6;
g:=6;
y:=8;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=4) then begin
b:=6;
g:=8;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
if (tttime=5) then begin
b:=8;
g:=6;
y:=6;
p:=1;
v:=1;
ketthuc:=1;
end;
end;
clrscr;writeln ('diem cua ban la:',diem);
write(a);
write(b);
write(c);
write(d);
writeln(e);
write(f);
write(g);
write(h);
write(j);
writeln(k);
write(x);
write(y);
write(z);
write(u);
writeln(i);
write(o);
write(p);
write(q);
write(r);
writeln(n);
write(m);
write(v);
write(w);
write(t);
writeln(l);
delay(550-diem*10);
diem:=diem+1;
if (ketthuc=0) then begin
if KeyPressed then
begin
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
ch:=ReadKey;
case ch of
#75 : if (ketthuc=0) then
begin
ttkey:=1;
end;
end;
end;
if (ttkey=1) then begin
if (tttime=5) then else tttime:=tttime+1;
end else
if (tttime=1) then else tttime:=tttime-1;
ttkey:=0;
if (tttime=1) then begin
b:=1;
g:=1;
y:=1;
p:=1;
v:=8;
end;
if (tttime=2) then begin
b:=1;
g:=1;
y:=1;
p:=8;
v:=1;
end;
if (tttime=3) then begin
b:=1;
g:=1;
y:=8;
p:=1;
v:=1;
end;
if (tttime=4) then begin
b:=1;
g:=8;
y:=1;
p:=1;
v:=1;
end;
if (tttime=5) then begin
b:=8;
g:=1;
y:=1;
p:=1;
v:=1;
end;
if (rd=0) then begin
a:=1;
f:=1;
x:=6;
o:=6;
m:=6;
end;
if (rd=1) then begin
a:=6;
f:=1;
x:=1;
o:=6;
m:=6;
end;
if (rd=2) then begin
a:=6;
f:=6;
x:=1;
o:=1;
m:=6;
end;
if (rd=3) then begin
a:=6;
f:=6;
x:=6;
o:=1;
m:=1;
end;
clrscr;writeln ('diem cua ban la:',diem);
viết(a);
viết(b);
viết(c);
viết(d);
writeln(e);
viết(f);
viết(g);
viết(h);
viết(j);
writeln(k);
viết(x);
viết(y);
ghi(z);
viết(u);
writeln(i);
viết(o);
viết (p);
viết(q);
nhà văn);
writeln(n);
viết(m);
viết(v);
viết(w);
viết(t);
writeln(l);
độ trễ(550 điểm*10);
nếu KeyPressed thì
bắt đầu
ch:=ReadKey;
trường hợp ch của
#75 : nếu (ketthuc=0) thì
bắt đầu
ttkey:=1;
kết thúc;
kết thúc;
ch:=ReadKey;
trường hợp ch của
#75 : nếu (ketthuc=0) thì
bắt đầu
ttkey:=1;
kết thúc;
kết thúc;
kết thúc;
nếu (ttkey=1) thì bắt đầu
if (tttime=5) then other tttime:=tttime+1;
hơn là khác
if (tttime=1) then other tttime:=tttime-1;
ttkey:=0;
nếu (tttime=1) thì bắt đầu
b:=1;
g:=1;
và:=1;
p:=1;
v:=8;
kết thúc;
nếu (tttime=2) thì bắt đầu
b:=1;
g:=1;
và:=1;
p:=8;
trong:=1;
kết thúc;
nếu (tttime=3) thì bắt đầu
b:=1;
g:=1;
và:=8;
p:=1;
trong:=1;
kết thúc;
nếu (tttime=4) thì bắt đầu
b:=1;
g:=8;
và:=1;
p:=1;
trong:=1;
kết thúc;
nếu (tttime=5) thì bắt đầu
b:=8;
g:=1;
và:=1;
p:=1;
trong:=1;
kết thúc;
a:=1;
f:=1;
x:=1;
o:=1;
m:=1;
clrscr;
writeln ('diem cua ban la:',diem);
viết(a);
viết(b);
viết(c);
viết(d);
writeln(e);
viết(f);
viết(g);
viết(h);
viết(j);
writeln(k);
viết(x);
viết(y);
ghi(z);
viết(u);
writeln(i);
viết(o);
viết (p);
viết(q);
nhà văn);
writeln(n);
viết(m);
viết(v);
viết(w);
viết(t);
writeln(l);
kết thúc;
cho đến khi ketthuc=1;
writeln('trò chơi kết thúc');
writeln('game duoc lap trinh boi phuc');
đọc;
kết thúc.
Xin lỗi mọi người, hồi đó học tin năm lớp 8 mới chỉ học pascal mấy cái lệnh cơ bản, chưa học mảng, hàm, thủ tục,... mà lại thích thể hiện làm mấy cái game nên code hồi đó viết hơi bị trẩu, mong mn thông cảm
 
  • Love
Reactions: b2c.manage

Huỳnh Văn Nguyên Phúc

Học sinh
Thành viên
24 Tháng mười 2020
5
9
21
17
Thừa Thiên Huế
Trương THCS Vinh Thanh
Xin lỗi mọi người, hồi đó học tin năm lớp 8 mới chỉ học pascal mấy cái lệnh cơ bản, chưa học mảng, hàm, thủ tục,... mà lại thích thể hiện làm mấy cái game nên code hồi đó viết hơi bị trẩu, mong mn thông cảm
 
  • Love
Reactions: b2c.manage
Top Bottom