Académique Documents
Professionnel Documents
Culture Documents
readln (superior);
num:=2;
repeat
soma:=soma+num;
num:=num+2;
writeln('A soma dos números pares de 2 até ', superior,' é ', soma);
readln;
end.
program pares;
var
x, y: integer;
begin
readln(x, y);
x := x + 1;
while x<= y do
begin
x := x + 2;
end;
writeln('Fim da Lista');
end.
jogo simples
program fantasma ;
uses crt ;
var xf, yf, xn, yn, xt, yt, x, y, d, p, level, hpf : integer ;
begin
gotoxy(x-1,y-4);
write(hpf);
TextBackground(White);
gotoxy(x-1,y-3);
write(' ');
gotoxy(x-2,y-2);
write(' ');
gotoxy(x,y-2);
write(' ');
gotoxy(x+2,y-2);
write(' ');
gotoxy(x-2,y-1);
write(' ');
gotoxy(x-2,y);
write(' ');
TextBackground(black);
repeat
gotoxy(p,y);
write(' ');
p:=p+2;
until ( p>70);
p:=0;
end;
begin
TextBackground(blue);
gotoxy(x,y-3);
write(' ');
gotoxy(x-1,y-2);
write(' ');
gotoxy(x-2,y-1);
write(' ');
gotoxy(x-2,y);
write(' ');
gotoxy(x+2,y);
write(' ');
TextBackground(black);
end;
begin
TextBackground(red);
gotoxy(x,y);
write(' ');
TextBackground(black);
end;
begin
TextBackground(White);
gotoxy(x-2,y-4);
write(' ');
gotoxy(x-3,y-3);
write(' ');
gotoxy(x-3,y-2);
write(' ');
gotoxy(x-3,y-1);
write(' ');
gotoxy(x-2,y);
write(' ');
delay(50);
TextBackground(black);
clrscr;
TextBackground(White);
gotoxy(x-1,y-4);
write(' ');
gotoxy(x-2,y-3);
write(' ');
gotoxy(x-3,y-2);
write(' ');
gotoxy(x-2,y-1);
write(' ');
gotoxy(x-1,y);
write(' ');
delay(50);
TextBackground(black);
clrscr;
TextBackground(White);
gotoxy(x-1,y-3);
write(' ');
gotoxy(x-2,y-2);
write(' ');
gotoxy(x-1,y-1);
write(' ');
delay(50);
TextBackground(black);
clrscr;
TextBackground(White);
gotoxy(x-1,y-2);
write(' ');
delay(50);
TextBackground(black);
clrscr;
gotoxy(x-1,y-2);
write('*');
delay(50);
TextBackground(black);
clrscr;
gotoxy(x-2,y-3);
write('\|/');
gotoxy(x-2,y-2);
write('-*-');
gotoxy(x-2,y-1);
write('/|\');
delay(50);
TextBackground(black);
clrscr;
gotoxy(x-3,y-4);
write('\ | /');
gotoxy(x-3,y-2);
write('- + -');
gotoxy(x-3,y-1);
write('/ | \');
delay(50);
TextBackground(black);
clrscr;
gotoxy(x-3,y-4);
write('\ | /');
gotoxy(x-3,y-2);
write('- -');
gotoxy(x-3,y-1);
write('/ | \');
delay(50);
TextBackground(black);
clrscr;
delay(500);
level:=level+1;
goto inicio;
end;
begin
xf:=5;
yf:=5;
xn:=20;
yn:=24;
d:=0 ;
p:=0;
level:=1;
while true
do
begin
inicio: