#codedao
uses crt;
var k:char; x,y,coin,t,kt,di,skin,dau:longint;
procedure ta;
begin
y:=7;
if (kt<>1) then begin gotoxy(1,1);writeln(coin); end;
if dau>=2 then dau:=0;
if dau>=1 then inc(dau);
if KeyPressed then
begin
k:=readkey;
if k=#32 then
begin
y:=7; t:=20;
// Nen
gotoxy(7,y); write(' A ');
gotoxy(7,y+1);write('<[o]> ');
gotoxy(7,y+2);write(' < > ');
//delay(200);
// Xoa
gotoxy(7,y); write(' ');
gotoxy(7,y+1); write(' ');
gotoxy(7,y+2); write(' ');
y:=8;
while y>2 do
begin
dec(y,2);
// Di 1
gotoxy(7,y); write(' A ');
gotoxy(7,y+1);write('/[o]/ ');
gotoxy(7,y+2);write(' / / ');
delay(100);
// Xoa
gotoxy(7,y); write(' ');
gotoxy(7,y+1); write(' ');
gotoxy(7,y+2); write(' ');
end;
end else
if (k='1')and(coin>4) then begin di:=-abs(di); dec(coin,5); dau:=1; end else
if (k='2')and(coin>9) then begin x:=1; dec(coin,10); end;
end else
begin
// Xoa
gotoxy(7,7); write(' ');
gotoxy(7,8); write(' ');
gotoxy(7,9); write(' ');
// Di 1
gotoxy(7,7);write(' A ');
gotoxy(7,8);write('/[o]\ ');
gotoxy(7,9);write(' | / ');
delay(300);
// Di 2
gotoxy(7,7);write(' A ');
gotoxy(7,8);write('/[o]\ ');
gotoxy(7,9);write(' / | ');
delay(300); inc(coin);
end;
if (dau=0) then di:=abs(di);
end;
procedure hard;
begin
x:=40; t:=di;
// Choose
if coin<70 then skin:=random(2) else
if coin<150 then skin:=random(5) else
if coin<230 then skin:=random(7);
while x>1 do
begin
if (x>13) then x:=x-t else
if t=20 then x:=1 else x:=x-t; t:=di;
//make
if skin<=2 then
begin
gotoxy(x,7);write(' xx ');
gotoxy(x,8);write(' xxxx ');
gotoxy(x,9);write('xxxxxx ');
ta;
gotoxy(x,7);write(' ');
gotoxy(x,8);write(' ');
gotoxy(x,9);write(' ');
if (x>6)and(x<12)and(y>5) then begin y:=0; gotoxy(1,1); writeln('GAME OVER'); kt:=1; end;
end else
if skin<=5 then
begin
gotoxy(x,6);write(' // ');
gotoxy(x,7);write('<O =< ');
gotoxy(x,8);write(' \\ ');
ta;
gotoxy(x,6);write(' ');
gotoxy(x,7);write(' ');
gotoxy(x,8);write(' ');
if (x>6)and(x<12)and(y>4) then begin y:=0; gotoxy(1,1); writeln('GAME OVER'); kt:=1; end;
end else
if skin<=7 then
begin
gotoxy(x,5);write('\ X <O');
gotoxy(x,6);write(' \/[x]\|');
gotoxy(x,7);write(' / \ ');
gotoxy(x,8);write(' [ ] ');
ta;
gotoxy(x,5);write(' ');
gotoxy(x,6);write(' ');
gotoxy(x,7);write(' ');
gotoxy(x,8);write(' ');
if (x>6)and(x<12)and(y>3) then begin y:=0; gotoxy(1,1); writeln('GAME OVER'); kt:=1; end;
end
end;
if kt=0 then
if coin<20 then inc(coin,3) else
if coin<40 then inc(coin,4) else
if coin<60 then inc(coin,5) else
if coin<80 then inc(coin,6) else
if coin<100 then inc(coin,7) else
if coin<120 then inc(coin,8);
end;
//Chinh
begin
clrscr;
gotoxy(1,14); write('HUONG DAN Nhan khoang trang de nhay');
gotoxy(1,15); write('CHIEU THUC [0. Thoat] [1. Day ra xa (-5)] [2. Pha huy (-10)]');
randomize; dau:=0;
repeat
ta;
if coin<20 then di:=3 else
if coin<40 then di:=4 else
if coin<80 then di:=5 else
if coin<120 then di:=6 else
if coin<180 then di:=10 else
if coin<260 then di:=12;
if coin mod 5=0 then hard;
until (k='0')or(kt=1);
readln;
end.
Bạn paste nốt dòng thứ 215 đến hết và elif bạn thụt vào và else ở dòng 218 thì bạn để ở ngoài lề
và thư viện pyfiglet thì bạn gõ:
$\text{pip install pyfiglet}$
được sư đồng ý từ bạn tus nên mình code cho bạn ý bằng python
no copy mạng
Tin học, tiếng Anh: informatics, tiếng Pháp: informatique, là một ngành khoa học chuyên nghiên cứu quá trình tự động hóa việc tổ chức, lưu trữ, xử lý và truyền dẫn thông tin của một hệ thống máy tính cụ thể hoặc trừu tượng (ảo). Với cách hiểu hiện nay, tin học bao hàm tất cả các nghiên cứu và kỹ thuật có liên quan đến việc mô phỏng, biến đổi và tái tạo thông tin.
Nguồn : Wikipedia - Bách khoa toàn thưLớp 6 - Là năm đầu tiên của cấp trung học cơ sở. Được sống lại những khỉ niệm như ngày nào còn lần đầu đến lớp 1, được quen bạn mới, ngôi trường mới, một tương lai mới!
Nguồn : ADMIN :))Copyright © 2021 HOCTAP247