Vous êtes sur la page 1sur 7

write ('Entre com o limite superior');

readln (superior);

num:=2;

repeat

soma:=soma+num;

num:=num+2;

until (num > superior);

writeln('A soma dos números pares de 2 até ', superior,' é ', soma);

readln;

end.

Números pares entre dois valores inteiros

program pares;

var

x, y: integer;

begin

writeln('Digite os dois valores');

readln(x, y);

if (x mod 2)<> 0 then

x := x + 1;

while x<= y do

begin

writeln(x, ' - ');

x := x + 2;

end;

writeln('Fim da Lista');

end.
jogo simples

nave contra fantasma.

program fantasma ;

uses crt ;

var xf, yf, xn, yn, xt, yt, x, y, d, p, level, hpf : integer ;

var acao : char;

label byebye, inicio ;

procedure fanta2 (x,y :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;

procedure nave (x,y : integer);

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;

procedure tiro (x,y : integer);

begin

TextBackground(red);

gotoxy(x,y);
write(' ');

TextBackground(black);

end;

procedure bomba(x,y : integer);

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:

Vous aimerez peut-être aussi