Dabar yra 2012 Vas 08 20:55




Naujos temos kūrimas Atsakyti į temą  [ 12 pranešimai(ų) ]  Eiti į Ankstesnis  1, 2
Programavimas Pascal'iu 
Autorius Žinutė

Užsiregistravo: 2008 Rgp 20 17:37
Pranešimai: 438
Standartinė Re: Programavimas Pascal'iu
Su pascaliu galima labai naudingų dalykų sau pasidaryt, nuo skaičiuoklės iki sunkių daugiafunkcinių programų... Nors programavimas pascaliu naudos tik tiek realios teduoda, kad mokant galima valstybinį egzaminą išlaikyt informatikos..

_________________
Paveikslėlis
Naujienos Internete | Moto News


2008 Rgp 26 02:28
Aprašymas
Vartotojo avataras

Užsiregistravo: 2008 Rgp 19 22:47
Pranešimai: 22
Standartinė Re: Programavimas Pascal'iu
Na jei jau idejote source, as irgi prisiminiau, kad vieną turiu seną seną dar užsilikusį :) 9 klasėje buvau gavęs vieną užsakymą, padaryti vienam dvyliktokui baigiamąjį darbą informatikos, tai dariau tokį žaidimuką :) . Manau niekas nesupyks, kad dabar paviešinsiu visgi jau 10m. praėjo. O gal kam ydomu bus. Tiesa pažiurėjus dabar biski baisus kodas atrodo, bet kaip 9-tokui manau nieko buvo :) yra ir assamblerio eilučiu (kas nežino tai asm - mašininis kodas) :)

Kodas:
{*
        Zaidimas "Gyvatele"

        Programa kure:
        V.Jurgucio vid. m-kla. 9a kl. mokinys
                   Gediminas Gricius
                   1999 PALANGA
***************************************************************
}
program givate;
uses crt,dos;
type
taskas=record
      x:1..71;
      y:1..25;
     end;
rekord=record
  vardas:string;
  taskai:integer;
     end;
var mas:array[1..45]of taskas;
     ta:taskas;
     sud:array[1..500]of taskas;
     val,min,sek,mse,val1,min1,sk9,sek1,mse1:word;
     c,c1:char;
     pabaiga,taskai,time,prideti,nariai,sk1,sk2,kiek:integer;
     x,y,x1,y1,s,ats,sk,atit,auk:byte;
     pradzia,vard,text1:string;

procedure Perkelk(x,y:byte);
begin
asm
     dec y
     dec x
     push ax
     push bx
     push dx
     mov ah,02h
     mov bh,0h
     mov dh,y
     mov dl,x
     int 10h
     pop dx
     pop bx
     pop ax
end;
end;

procedure AtspauzdCh(i:byte);
begin
asm
  push ax
  mov ah,0eh
  mov al,i
  int 10h
  pop ax
end;
end;

procedure Tarpas;
begin
asm
  push ax
  mov ah,0eh
  mov ax,0e20h
  int 10h
  pop ax
end;
end;

function langas:integer;
var atit,auk,sk,sk1,pasi:integer;
     y,y1:byte;
     c:char;
     text:array[1..8]of string;
begin
delay(500);
textcolor(0);
Perkelk(80,25);
Tarpas;
for sk:=1 to 13 do
  begin
   writeln;
   delay(500);
  end;
atit:=30;
auk:=8;
for sk:=1 to atit do
  Tarpas;
atspauzdCh(201);
for sk:=1 to 80-(2*atit)-2 do
  AtspauzdCh(205);
AtspauzdCh(187);
for sk:=1 to atit do
  Tarpas;
delay(500);
for sk:=1 to auk do
  begin
   for sk1:=1 to atit do
    Tarpas;
   AtspauzdCh(186);
   for sk1:=1 to 80-(2*atit)-2 do
    Tarpas;
   AtspauzdCh(186);
   for sk1:=1 to atit do
    Tarpas;
    delay(500);
  end;
for sk:=1 to atit do
  Tarpas;
AtspauzdCh(200);
for sk:=1 to 80-(2*atit)-2 do
  AtspauzdCh(205);
AtspauzdCh(188);
writeln;
Perkelk(1,25);
for sk:=1 to (25-auk) div 2 do
  begin
  writeln;
  delay(500);
  end;
  pasi:=1;
  text[1]:='Pradeti';
  text[2]:='Lygis';
  text[3]:='Kambarys';
  text[4]:='Kambario statymas';
  text[5]:='Rekordai';
  text[6]:='Paaiskinimai';
  text[7]:='Pabaiga';
  textbackground(2);
  Perkelk(atit+2,((25-auk)div 2));
  y:=wherey;
  y1:=y;
  write(text[1]);
  textbackground(1);
  Perkelk(atit+2,((25-auk)div 2)+1);
  write(text[2]);
  Perkelk(atit+2,((25-auk)div 2)+2);
  write(text[3]);
  Perkelk(atit+2,((25-auk)div 2)+3);
  write(text[4]);
  Perkelk(atit+2,((25-auk)div 2)+4);
  write(text[5]);
  Perkelk(atit+2,((25-auk)div 2)+5);
  write(text[6]);
  Perkelk(atit+2,((25-auk)div 2)+6);
  write(text[7]);
repeat
   c:=readkey;
   if c=#0 then begin
    c:=readkey;
     case c of
      #72: begin
            if y>y1
             then
              begin
               perkelk(atit+2,y);
               write(text[pasi]);
               y:=y-1;
               pasi:=pasi-1;
               perkelk(atit+2,y);
               textbackground(2);
               write(text[pasi]);
               textbackground(1);
              end
             else write(^G);
           end;
      #80: begin
            if y<(y1+6)
             then
              begin
               perkelk(atit+2,y);
               write(text[pasi]);
               y:=y+1;
               pasi:=pasi+1;
               perkelk(atit+2,y);
               textbackground(2);
               write(text[pasi]);
               textbackground(1);
              end
             else write(^G);
           end;
     end;
   end;
  until c=#13;
  langas:=pasi;
end;
procedure paaisk;
var sk:byte;
begin
perkelk(80,25);
Tarpas;
for sk:=1 to 10 do
  begin
   writeln;
   delay(500);
  end;
writeln('Nuveskite gyvate prie maisto, kad ji pailgetu.');
delay(500);
writeln('Klavisai (',chr(24),chr(25),chr(27),chr(26),') sukioja gyvate.');
delay(500);
writeln('Negalima jos sustabdyti ar priversti sliauzti atbula.');
delay(500);
writeln('Stenkites, kad gyvate neatsiremtu i sieneles, kliutis arba savo pacios uodega.');
delay(500);
writeln('Noredami uzsiregistruoti kitu vardu isijunkite zaidima is naujo.');
delay(500);
writeln('Noredami iseiti is "KAMBARIU KURIMO" paspauskite "Q"');
delay(500);
for sk:=1 to 12 do
  begin
   writeln;
   delay(500);
  end;
readkey;
end;
Procedure rekordai;
var fil:text;
     rek:array [1..10] of rekord;
     sk,sk1,atit,auk,pasi:integer;
     c:char;
     text:array[1..10] of string;
begin
  assign(fil,'Rekordai.dat');
  reset(fil);
  for sk:=1 to 10 do
   begin
    readln(fil,rek[sk].vardas);
    readln(fil,rek[sk].taskai);
   end;
close(fil);
perkelk(80,25);
Tarpas;
for sk:=1 to 12 do
   writeln;
textbackground(1);
perkelk(80,25);
Tarpas;
atit:=29;
auk:=11;
for sk:=1 to atit do
  Tarpas;
AtspauzdCh(201);
for sk:=1 to 12 do
  AtspauzdCh(205);
write(chr(203));
for sk:=1 to 7 do
  AtspauzdCh(205);
AtspauzdCh(187);
for sk:=1 to atit do
  Tarpas;
delay(500);
for sk:=1 to atit do
  Tarpas;
AtspauzdCh(186);
write(' Vardas     ');
AtspauzdCh(186);
write('Taskai ');
AtspauzdCh(186);
for sk:=1 to atit do
  Tarpas;
for sk:=1 to atit do
  Tarpas;
write(chr(204));
for sk:=1 to 12 do
  AtspauzdCh(205);
write(chr(206));
for sk:=1 to 7 do
  AtspauzdCh(205);
write(chr(185));
for sk:=1 to atit do
  Tarpas;
delay(500);
for sk:=1 to auk do
  begin
   for sk1:=1 to atit do
    Tarpas;
   AtspauzdCh(186);
   for sk1:=1 to 12 do
    Tarpas;
   AtspauzdCh(186);
   for sk1:=1 to 7 do
    Tarpas;
   AtspauzdCh(186);
   for sk1:=1 to atit do
    Tarpas;
   delay(500);
  end;
for sk:=1 to atit do
  Tarpas;
AtspauzdCh(200);
for sk:=1 to 12 do
  AtspauzdCh(205);
write(chr(202));
for sk:=1 to 7 do
  AtspauzdCh(205);
AtspauzdCh(188);
writeln;
for sk:=1 to 5 do
  begin
   writeln;
   delay(500);
  end;
  for sk:=1 to 10 do
   begin
    perkelk(atit+2,((25-auk)div 2)+sk);
    write(rek[sk].vardas,' ');
    perkelk(atit+15,((25-auk)div 2)+sk);
    write(rek[sk].taskai);
   end;
  repeat
   c:=readkey;
  until c=#13;
end;
function lygis:integer;
var atit,auk,sk,sk1:integer;
     pasi,y,y1:byte;
     text:array[1..5]of string;
     c:char;
begin
  perkelk(80,25);
  Tarpas;
  atit:=30;
  auk:=7;
  for sk:=1 to atit do
   Tarpas;
  AtspauzdCh(201);
  for sk:=1 to 80-(2*atit)-2 do
   AtspauzdCh(205);
  AtspauzdCh(187);
  for sk:=1 to atit do
   Tarpas;
  delay(500);
  for sk:=1 to auk do
   begin
    for sk1:=1 to atit do
     Tarpas;
    AtspauzdCh(186);
    for sk1:=1 to 80-(2*atit)-2 do
     Tarpas;
    AtspauzdCh(186);
    for sk1:=1 to atit do
     Tarpas;
     delay(500);
   end;
  for sk:=1 to atit do
   Tarpas;
  AtspauzdCh(200);
  for sk:=1 to 80-(2*atit)-2 do
   AtspauzdCh(205);
  AtspauzdCh(188);
  writeln;
  perkelk(1,25);
  for sk:=1 to (25-auk) div 2 do
   begin
    writeln;
    delay(500);
   end;
  pasi:=1;
  text[1]:='Labai Lengvas';
  text[2]:='Lengvas';
  text[3]:='Normalus';
  text[4]:='Sunkus';
  text[5]:='Labai sunkus';
  textbackground(2);
  perkelk(atit+2,((25-auk)div 2)-1);
  y:=wherey;
  y1:=y;
  write(text[1]);
  textbackground(1);
  perkelk(atit+2,((25-auk)div 2));
  write(text[2]);
  perkelk(atit+2,((25-auk)div 2)+1);
  write(text[3]);
  perkelk(atit+2,((25-auk)div 2)+2);
  write(text[4]);
  perkelk(atit+2,((25-auk)div 2)+3);
  write(text[5]);
repeat
   c:=readkey;
   if c=#0 then begin
    c:=readkey;
     case c of
      #72: begin
            if y>y1
             then
              begin
               perkelk(atit+2,y);
               write(text[pasi]);
               y:=y-1;
               pasi:=pasi-1;
               perkelk(atit+2,y);
               textbackground(2);
               write(text[pasi]);
               textbackground(1);
              end
             else write(^G);
           end;
      #80: begin
            if y<(y1+4)
             then
              begin
               perkelk(atit+2,y);
               write(text[pasi]);
               y:=y+1;
               pasi:=pasi+1;
               perkelk(atit+2,y);
               textbackground(2);
               write(text[pasi]);
               textbackground(1);
              end
             else write(^G);
           end;
     end;
   end;
  until c=#13;
  case pasi of
   1: begin
       lygis:=4000;
       sk2:=1;
      end;
   2: begin
       lygis:=3000;
       sk2:=2;
      end;
   3: begin
       lygis:=2000;
       sk2:=3;
      end;
   4: begin
       lygis:=1000;
       sk2:=4;
      end;
   5: begin
       lygis:=500;
       sk2:=5;
      end;
  end;
end;
procedure intro2;
var a,b:integer;
begin
perkelk(80,25);
delay(500);
Tarpas;
delay(500);
textbackground(red);
AtspauzdCh(201);
for a:=2 to 70 do
  AtspauzdCh(205);
write(chr(203));
for a:=72 to 79 do
  AtspauzdCh(205);
AtspauzdCh(187);
delay(500);
for a:=2 to 24 do
  begin
   AtspauzdCh(186);
   textbackground(1);
   for b:=2 to 70 do
    Tarpas;
   textbackground(red);
   AtspauzdCh(186);
   for b:=72 to 79 do
    Tarpas;
   AtspauzdCh(186);
   delay(500);
  end;
AtspauzdCh(200);
for a:=2 to 70 do
  AtspauzdCh(205);
write(chr(202));
for a:=72 to 79 do
  AtspauzdCh(205);
delay(500);
textbackground(1);
end;
procedure ejimas(c:char);
var sko:integer;
begin
  if prideti<>0 then
   inc(nariai);
  case c of
   #72:begin
        if mas[1].y>2 then
         begin
          if prideti<>0
           then prideti:=0
           else begin
                 perkelk(mas[nariai].x,mas[nariai].y);
                 Tarpas;
                end;
          ta:=mas[1];
          ta.y:=mas[1].y-1;
          for sko:=nariai downto 2 do
           begin
            mas[sko]:=mas[sko-1];
            if (ta.x=mas[sko].x) and (ta.y=mas[sko].y)
             then pabaiga:=1;
           end;
          mas[1]:=ta;
          perkelk(mas[1].x,mas[1].y);
          write(chr(254));
          perkelk(mas[1].x,mas[1].y);
          delay(time*2);
         end
         else pabaiga:=1;
       end;
   #80:begin
        if mas[1].y<24 then
         begin
          if prideti<>0
           then prideti:=0
           else begin
                 perkelk(mas[nariai].x,mas[nariai].y);
                 Tarpas;
                end;
          ta:=mas[1];
          ta.y:=mas[1].y+1;
          for sko:=nariai downto 2 do
           begin
            mas[sko]:=mas[sko-1];
            if (ta.x=mas[sko].x) and (ta.y=mas[sko].y)
             then pabaiga:=1;
           end;
          mas[1]:=ta;
          perkelk(mas[1].x,mas[1].y);
          write(chr(254));
          perkelk(mas[1].x,mas[1].y);
          delay(time*2);
         end
         else pabaiga:=1;
        end;
   #75:begin
        if mas[1].x>2 then
         begin
          if prideti<>0
           then prideti:=0
           else begin
                 perkelk(mas[nariai].x,mas[nariai].y);
                 Tarpas;
                end;
          ta:=mas[1];
          ta.x:=mas[1].x-1;
          for sko:=nariai downto 2 do
           begin
            mas[sko]:=mas[sko-1];
            if (ta.x=mas[sko].x)and(ta.y=mas[sko].y)
             then pabaiga:=1;
           end;
          mas[1]:=ta;
          perkelk(mas[1].x,mas[1].y);
          write(chr(254));
          perkelk(mas[1].x,mas[1].y);
          delay(time);
         end
         else pabaiga:=1;
        end;
   #77:begin
        if mas[1].x<70 then
         begin
          if prideti<>0
           then prideti:=0
           else begin
                 perkelk(mas[nariai].x,mas[nariai].y);
                 Tarpas;
                end;
          ta:=mas[1];
          ta.x:=mas[1].x+1;
          for sko:=nariai downto 2 do
           begin
            mas[sko]:=mas[sko-1];
            if (ta.x=mas[sko].x)and(ta.y=mas[sko].y)
             then pabaiga:=1;
           end;
          mas[1]:=ta;
          perkelk(mas[1].x,mas[1].y);
          write(chr(254));
          perkelk(mas[1].x,mas[1].y);
          delay(time);
         end
         else pabaiga:=1;
       end;
   end;
for sko:=1 to kiek do
  if (sud[sko].x=mas[1].x) and (sud[sko].y=mas[1].y)
      then pabaiga:=1;
end;
procedure zaidimas;
label atgal;
var   fil:text;
       rek:array[1..10]of rekord;
       sk,sk1,atit,auk,pasi,sug:integer;
       keist1,keist2:rekord;
       deti:boolean;
       text1:string;
       text:array[1..5]of string;
begin
assign(fil,'Rekordai.dat');
reset(fil);
for sk:=1 to 10 do
  begin
   readln(fil,rek[sk].vardas);
   readln(fil,rek[sk].taskai);
  end;
close(fil);
taskai:=0;
sug:=0;
intro2;
textbackground(red);
perkelk(73,2);
Write('Laikas:');
getTime(val,min,sek,mse);
randomize;
val1:=0;
min1:=0;
sek1:=0;
mse1:=0;
perkelk(73,5);
write('Taskai:');
perkelk(75,6);
write(taskai);
textbackground(1);
if kiek<>0 then
  begin
   for sk:=1 to kiek do
    begin
    perkelk(sud[sk].x,sud[sk].y);
    write(chr(219));
   end;
    textbackground(red);
    perkelk(72,7);
    write('Kambarys');
    perkelk(72,8);
    write(pradzia);
    textbackground(1);
  end;
perkelk(35,12);
x:=35;
y:=12;
mas[1].x:=x;
mas[1].y:=y;
for sk1:= 2 to 5 do
  mas[sk1]:=mas[1];
nariai:=5;
prideti:=0;
randomize;
x1:=random(70)+2;
y1:=random(23)+2;
textcolor(yellow);
perkelk(x1,y1);
write('*');
textcolor(0);
pabaiga:=0;
perkelk(mas[1].x,mas[1].y);
textbackground(red);
textbackground(1);
setTime(val1,min1,sek1,mse1);
repeat
  if (mas[1].x=x1)and(mas[1].y=y1)
   then
    begin
     sound(500);
     delay(100);
     nosound;
     textbackground(red);
     perkelk(73,5);
     write('Taskai:');
     perkelk(75,6);
     inc(sug);
     taskai:=sug*sk2;
     write(taskai);
     textbackground(1);
     deti:=false;
     while deti<>true do
      begin
       x1:=random(68)+2;
       y1:=random(23)+2;
       deti:=true;
       for sk:=1 to nariai do
        if (mas[sk].x=x1)and(mas[sk].y=y1)
         then deti:=false;
       for sk:=1 to kiek do
        if (sud[sk].x=x1)and(sud[sk].y=y1)
         then deti:=false;
      end;
     perkelk(x1,y1);
     textcolor(yellow);
     write('*');
     textcolor(0);
     time:=time-50;
     prideti:=1;
    end;
  if keypressed
   then
    begin
     c1:=readkey;
     if c1=#0
      then
       begin
        c1:=readkey;
        case c1 of
         #72: if c=#80 then goto atgal;
         #80: if c=#72 then goto atgal;
         #75: if c=#77 then goto atgal;
         #77: if c=#75 then goto atgal;
        end;
        c:=c1;
        ejimas(c);
       end;
    end
   else atgal:ejimas(c);
   textbackground(red);
   perkelk(74,3);
   getTime(val1,min1,sek1,mse1);
   write(min1:2,':',sek1:2);
   textbackground(1);
until pabaiga=1;
sound(880);
delay(2000);
nosound;
delay(2000);
sound(880);
delay(2000);
nosound;
sound(880);
delay(2000);
nosound;
sound(880);
delay(2000);
nosound;
setTime(val,min,sek,mse);
perkelk(80,25);
Tarpas;
for sk:=1 to 14 do
   writeln;
atit:=30;
auk:=2;
for sk:=1 to atit do
Tarpas;
AtspauzdCh(201);
for sk:=1 to 80-(2*atit)-2 do
   AtspauzdCh(205);
  AtspauzdCh(187);
   for sk:=1 to atit do
    Tarpas;
   delay(500);
   for sk:=1 to auk do
    begin
     for sk1:=1 to atit do
      Tarpas;
     AtspauzdCh(186);
     for sk1:=1 to 80-(2*atit)-2 do
      Tarpas;
     AtspauzdCh(186);
     for sk1:=1 to atit do
      Tarpas;
      delay(500);
    end;
   for sk:=1 to atit do
    Tarpas;
   AtspauzdCh(200);
   for sk:=1 to 80-(2*atit)-2 do
    AtspauzdCh(205);
   AtspauzdCh(188);
   writeln;
   perkelk(1,25);
   for sk:=1 to (25-auk) div 2 do
    begin
     writeln;
     delay(500);
    end;
   text1:='Jus surinkote:';
   perkelk(atit+2,((25-auk)div 2));
   write(text1);
   perkelk(atit+2,((25-auk)div 2)+1);
   WRITE(taskai);
   repeat
    c:=readkey;
   until c=#13; 
if (rek[10].taskai<taskai)and(rek[1].taskai>=taskai) then
  begin
   sk:=10;
   while taskai>rek[sk].taskai do
    sk:=sk-1;
   inc(sk);
   for sk2:=10 downto sk+1 do
    rek[sk2]:=rek[sk2-1];
   rek[sk].vardas:=vard;
   rek[sk].taskai:=taskai;
   assign(fil,'Rekordai.dat');
   rewrite(fil);
   for sk:=1 to 10 do
    begin
     writeln(fil,rek[sk].vardas);
     writeln(fil,rek[sk].taskai);
    end;
   close(fil);
  end;
if rek[1].taskai<taskai then
  begin
   for sk2:=10 downto 1 do
    rek[sk2]:=rek[sk2-1];
   rek[1].vardas:=vard;
   rek[1].taskai:=taskai;
   assign(fil,'Rekordai.dat');
   rewrite(fil);
   for sk:=1 to 10 do
    begin
     writeln(fil,rek[sk].vardas);
     writeln(fil,rek[sk].taskai);
    end;
   close(fil);
  end;
time:=2000;
sk2:=3;
kiek:=0;
pradzia:='';
rekordai;
end;
procedure nau;
var c:char;
     x,y,sk,sk1,atit,auk:byte;
     fie:text;
     iseina:boolean;
begin
delay(500);
textcolor(0);
perkelk(80,25);
Tarpas;
atit:=25;
auk:=2;
for sk:=1 to atit do
  Tarpas;
AtspauzdCh(201);
for sk:=1 to 80-(2*atit)-2 do
  AtspauzdCh(205);
AtspauzdCh(187);
for sk:=1 to atit do
  Tarpas;
delay(500);
for sk:=1 to auk do
  begin
   for sk1:=1 to atit do
    Tarpas;
   AtspauzdCh(186);
   for sk1:=1 to 80-(2*atit)-2 do
    Tarpas;
   AtspauzdCh(186);
   for sk1:=1 to atit do
    Tarpas;
    delay(500);
  end;
for sk:=1 to atit do
  Tarpas;
AtspauzdCh(200);
for sk:=1 to 80-(2*atit)-2 do
  AtspauzdCh(205);
AtspauzdCh(188);
writeln;
perkelk(1,25);
for sk:=1 to (25-auk) div 2 do
  begin
  writeln;
  delay(500);
  end;
perkelk(atit+2,((25-auk)div 2));
Write('Iveskite kambario pavadinima');
perkelk(atit+2,((25-auk)div 2)+1);
readln(pradzia);
kiek:=0;
clrscr;
intro2;
textbackground(red);
perkelk(72,6);
write('Kambarys');
perkelk(73,7);
write(pradzia);
textbackground(1);
perkelk(40,12);
x:=whereX;
y:=whereY;
repeat
  c:=readkey;
  if c=#0 then begin
   c:=readkey;
   case c of
    #72: begin
          if y>2 then begin
           Tarpas;
           y:=y-1;
           perkelk(x,y);
           write('*');
           perkelk(x,y);
           end
           else write(^G)
          end;
    #80: begin
          if y<24 then begin
           Tarpas;
           y:=y+1;
           perkelk(x,y);
           write('*');
           perkelk(x,y);
           end
           else write(^G);
         end;
   #75: begin
         if x>2 then begin
           Tarpas;
           x:=x-1;
           perkelk(x,y);
           write('*');
           perkelk(x,y);
           end
           else write(^G);
        end;
   #77: begin
         if x<70 then begin
           Tarpas;
           x:=x+1;
           perkelk(x,y);
           write('*');
           perkelk(x,y);
           end
           else write(^G);
           end;
        end;
   end;
  if ord(c)=13 then
   begin
    iseina:=true;
    for sk:=1 to kiek do
      if (sud[sk].x=x)and(sud[sk].y=y)
       then iseina:=false;
      if iseina=true
       then
        begin
         inc(kiek);
         sud[kiek].x:=x;
         sud[kiek].y:=y;
        end;
   end;
  for sk:=1 to kiek do
   begin
    textbackground(red);
    perkelk(sud[sk].x,sud[sk].y);
    write(chr(219));
    textbackground(1);
    perkelk(sud[sk].x,sud[sk].y);
   end;
  textbackground(red);
  perkelk(73,2);
  write('     ');
  perkelk(73,2);
  write('X:',x);
  perkelk(73,3);
  write('     ');
  perkelk(73,3);
  write('     ');
  perkelk(73,3);
  Write('Y:',y);
  perkelk(73,4);
  write('Tasku:');
  perkelk(73,5);
  write('     ');
  perkelk(73,5);
  write(kiek);
  perkelk(x,y);
  textbackground(1);
until upcase(c)='Q';
end;
procedure kam;
var fil:text;
     atit,auk,sk,pasi:integer;
     text:array[1..50]of string;
begin
  perkelk(80,25);
  Tarpas;
  atit:=30;
  auk:=5;
  for sk:=1 to atit do
   Tarpas;
  AtspauzdCh(201);
  for sk:=1 to 80-(2*atit)-2 do
   AtspauzdCh(205);
  AtspauzdCh(187);
  for sk:=1 to atit do
   Tarpas;
  delay(500);
  for sk:=1 to auk do
   begin
    for sk1:=1 to atit do
     Tarpas;
    AtspauzdCh(186);
    for sk1:=1 to 80-(2*atit)-2 do
     Tarpas;
    AtspauzdCh(186);
    for sk1:=1 to atit do
     Tarpas;
     delay(500);
   end;
  for sk:=1 to atit do
   Tarpas;
  AtspauzdCh(200);
  for sk:=1 to 80-(2*atit)-2 do
   AtspauzdCh(205);
  AtspauzdCh(188);
  writeln;
  perkelk(1,25);
  for sk:=1 to (25-auk) div 2 do
   begin
    writeln;
    delay(500);
   end;
  pasi:=1;
  text[1]:='Zona';
  text[2]:='Linija';
  text[3]:='Minos';
  text[4]:='Klounas';
  text[5]:='Atodusis';
  textbackground(2);
  perkelk(atit+2,((25-auk)div 2)-1);
  y:=wherey;
  y1:=y;
  write(text[1]);
  textbackground(1);
  perkelk(atit+2,((25-auk)div 2));
  write(text[2]);
  perkelk(atit+2,((25-auk)div 2)+1);
  write(text[3]);
  perkelk(atit+2,((25-auk)div 2)+2);
  write(text[4]);
  perkelk(atit+2,((25-auk)div 2)+3);
  write(text[5]);
repeat
   c:=readkey;
   if c=#0 then begin
    c:=readkey;
     case c of
      #72: begin
            if y>y1
             then
              begin
               perkelk(atit+2,y);
               write(text[pasi]);
               y:=y-1;
               pasi:=pasi-1;
               perkelk(atit+2,y);
               textbackground(2);
               write(text[pasi]);
               textbackground(1);
              end
             else write(^G);
           end;
      #80: begin
            if y<(y1+4)
             then
              begin
               perkelk(atit+2,y);
               write(text[pasi]);
               y:=y+1;
               pasi:=pasi+1;
               perkelk(atit+2,y);
               textbackground(2);
               write(text[pasi]);
               textbackground(1);
              end
             else write(^G);
           end;
     end;
   end;
  until c=#13;
  case pasi of
   1: begin
       assign(fil,'1.usr');
       reset(fil);
       for sk:=1 to 4 do
        begin
         read(fil,sud[sk].x);
         read(fil,sud[sk].y);
        end;
       close(fil);
       kiek:=4;
       pradzia:='Zona';
      end;
   2: begin
       assign(fil,'2.usr');
       reset(fil);
       for sk:=1 to 47 do
        begin
         read(fil,sud[sk].x);
         read(fil,sud[sk].y);
        end;
       close(fil);
       kiek:=47;
       pradzia:='Linija';
      end;
   3: begin
       assign(fil,'3.usr');
       reset(fil);
       for sk:=1 to 22 do
        begin
         read(fil,sud[sk].x);
         read(fil,sud[sk].y);
        end;
       close(fil);
       kiek:=22;
       pradzia:='Minos';
      end;
  4: begin
       assign(fil,'4.usr');
       reset(fil);
       for sk:=1 to 36 do
        begin
         read(fil,sud[sk].x);
         read(fil,sud[sk].y);
        end;
       close(fil);
       kiek:=36;
       pradzia:='Klounas';
     end;
  5: begin
       assign(fil,'5.usr');
       reset(fil);
       for sk:=1 to 212 do
        begin
         read(fil,sud[sk].x);
         read(fil,sud[sk].y);
        end;
       close(fil);
       kiek:=212;
       pradzia:='Atodusis';
     end;
   end;
end;
begin
{init;}
textbackground(1);
clrscr;
perkelk(80,25);
Tarpas;
for sk:=1 to 14 do
    writeln;
   atit:=30;
   auk:=2;
   for sk:=1 to atit do
   Tarpas;
   AtspauzdCh(201);
   for sk:=1 to 80-(2*atit)-2 do
    AtspauzdCh(205);
   AtspauzdCh(187);
   for sk:=1 to atit do
    Tarpas;
   delay(500);
   for sk:=1 to auk do
    begin
     for sk1:=1 to atit do
      Tarpas;
     AtspauzdCh(186);
     for sk1:=1 to 80-(2*atit)-2 do
      Tarpas;
     AtspauzdCh(186);
     for sk1:=1 to atit do
      Tarpas;
      delay(500);
    end;
   for sk:=1 to atit do
    Tarpas;
   AtspauzdCh(200);
   for sk:=1 to 80-(2*atit)-2 do
    AtspauzdCh(205);
   AtspauzdCh(188);
   writeln;
   perkelk(1,25);
   for sk:=1 to (25-auk) div 2 do
    begin
     writeln;
     delay(500);
    end;
   text1:='Irasykite varda';
   textbackground(2);
   perkelk(atit+2,((25-auk)div 2));
   y:=wherey;
   y1:=y;
   write(text1);
   textbackground(1);
   perkelk(atit+2,((25-auk)div 2)+1);
   read(vard);
time:=2000;
sk2:=3;
repeat
  s:=textAttr;
  ats:=langas;
  case ats of
   1:zaidimas;
   2:time:=lygis;
   3:kam;
   4:nau;
   5:rekordai;
   6:paaisk;
   end;
until ats=7;
textattr:=s;
clrscr;
end.


2008 Lap 24 22:13
Aprašymas
Rodyti paskutinius pranešimus:  Rūšiuoti pagal  
Naujos temos kūrimas Atsakyti į temą  [ 12 pranešimai(ų) ]  Eiti į Ankstesnis  1, 2


Dabar prisijungę

Vartotojai naršantys šį forumą: Registruotų vartotojų nėra ir 0 svečių


Jūs negalite kurti naujų temų šiame forume
Jūs negalite atsakinėti į temas šiame forume
Jūs negalite redaguoti savo pranešimų šiame forume
Jūs negalite trinti savo pranešimų šiame forume
Jūs negalite prikabinti failų šiame forume

Ieškoti:
Pereiti į:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.
Vertė Vilius Šumskas © 2003, 2005, 2007
phpBB SEO