![]() |
![]() |
Clane |
![]()
Сообщение
#1
|
Гость ![]() |
Код Program Game; Uses crt; Var m,n,i,j,k,x,y,x1,x2,y1,y2: integer; a: char; flag:boolean;t: longint; PROCEDURE clr; Begin window(1,1,80,25); textbackground(0);clrscr; End; PROCEDURE Wait(t: Longint); Begin t:=t*9000; While t>0 do t:=t-1; End; PROCEDURE musik(h:word); Begin Sound(h); Delay(50000);NoSound; End; PROCEDURE eat; Begin if flag=false then begin i:=random(x2-x1-1); j:=random(y2-y1-2);end; if ((i mod 2)=0) then i:=i+1;if (i=0) or (i=1) then i:=i+4; if (j=0) or (j=1) then j:=j+3; gotoxy(i,j);Textcolor(4);Write(#3);Textcolor(14); End; PROCEDURE Pole; Begin Window(x1,y1,x2,y2);Textbackground(2);Textcolor(15);Clrscr; Write(#201);For k:=1 to x2-x1-1 do write(#205);Write(#187); For k:=1 to y2-y1-1 do begin gotoxy(1,k+1);write(#186);end;Gotoxy(1,k+1);write(#200); For k:=1 to y2-y1-1 do begin gotoxy(x2-x1+1,k+1);write(#186);end;gotoxy(x2-x1+1,k+1);write(#188); Gotoxy(2,y2-y1);For k:=1 to x2-x1-1 do write(#205); Gotoxy((x2-x1)div 2 -2,1);Textcolor(14);Write(' Game '); Gotoxy(x2-x1-4,y2-1);Writeln(' ',n,' ');Textcolor(14);Write(' Esc ');Textcolor(15); Write('to exit');Textcolor(14);eat;flag:=true; End; PROCEDURE Gameover; Begin Musik(494);Window(1,1,80,25);Textbackground(0);Textcolor(4);Clrscr; GotoXY(36,8);Write('Game over');GotoXY(37,9);Write(n,' balls');readkey; Halt; End; PROCEDURE dvig80; Begin While keypressed=false do Begin Pole;y:=y+1;Gotoxy(x,y);Write(#2);Gotoxy(14,y2-y1+1);Wait(t); if(x=i)and(y=j)then begin flag:=false;n:=n+1;Musik(294); if ((n mod 10)=0) and (t>560) then t:=t-560;end; if y=y2-1 then gameover; End; End; PROCEDURE dvig72; Begin While keypressed=false do Begin Pole;y:=y-1;Gotoxy(x,y);Write(#2);Gotoxy(14,y2-y1+1);Wait(t); if(x=i)and(y=j)then begin flag:=false;n:=n+1;Musik(294); if ((n mod 10)=0) and (t>560) then t:=t-560;end; if y=1 then gameover; End; End; PROCEDURE dvig75; Begin While keypressed=false do Begin Pole;x:=x-2;Gotoxy(x,y);Write(#2);Gotoxy(14,y2-y1+1);Wait(t); if(x=i)and(y=j)then begin flag:=false;n:=n+1;Musik(294); if ((n mod 10)=0) and (t>560) then t:=t-560;end; if x=1 then gameover End; End; PROCEDURE dvig77; Begin While keypressed=false do Begin pole;x:=x+2;Gotoxy(x,y);Write(#2);Gotoxy(14,y2-y1+1);Wait(t); if(x=i)and(y=j)then begin flag:=false;n:=n+1;Musik(294); if ((n mod 10)=0) and (t>560) then t:=t-560;end; if x=x2-x1+1 then gameover; End; End; BEGIN Clr; n:=0;t:=5600; i:=24;j:=5;flag:=true; x1:=15;y1:=1;x2:=65;y2:=25;Pole; x:=(x2-x1) div 2; y:=(y2-y1) div 2; Gotoxy(x,y);Write(#2);Gotoxy(14,y2-y1+1); While true do Begin a:=readkey; case a of #80: dvig80; #72: dvig72; #75: dvig75; #77: dvig77; #27: exit; end; End; END. |
![]() ![]() |
Slam |
![]()
Сообщение
#2
|
![]() Пионер ![]() ![]() Группа: Пользователи Сообщений: 136 Пол: Мужской Репутация: ![]() ![]() ![]() |
В догонку:
Код Program Smile; Uses Crt; Var x,y,x1,y1,N,I: integer; Ch:Char; BEGIN {Hide_Cursor;} TextBackGround(1); ClrScr; Randomize; N:=0; GotoXY(25,2); TextColor(11); Write('!!!ЊЋ—? ‡‹ЋѓЋ'); TextColor(15); Write(' "‘ЊЂ‰‹Ђ"!!! '); GotoXY(32,5); TextColor(10); TextBackGround(0); Write('‘зҐв: ',N*100); TextColor(14); TextBackGround(1); GotoXY(30,23); Write('“Їа ў«ҐЁҐ:'); GotoXY(28,24); Write('‘в५ЄЁ Єгаб®а '); GotoXY(58,25); Write('„«п ўл室 влЄ ©вҐ Esc'); TextColor(10); TextBackGround(0); GotoXY(9,9); Write('1'); For I:=1 to 51 do Write('Д'); Write('1'); For I:=1 to 11 do Begin GotoXY(9,I+9); Write('і і'); End; GotoXY(9,21); Write('1'); For I:=1 to 51 do Write('Д'); Write('1'); x:=10; y:=10; x1:=random(49)+10; y1:=random(9)+10; GotoXY(x1,y1); TextColor(15); Write('1'); Repeat If (x=x1) AND (y=y1) Then Begin GotoXY(43,5); TextColor(15); Write('+100'); x1:=random(49)+10; y1:=random(9)+10; GotoXY(x1,y1); TextColor(15); Write('1'); sound(767); delay(3000); sound(667); delay(3000); sound(567); delay(3000); sound(767); delay(3000); Nosound; N:=N+1; GotoXY(27,5); TextColor(10); Write('‘зҐв: ',N*100); GotoXY(43,5); TextColor(0); Write('+100'); End; GotoXY(x,y); TextColor(4); Write('1'); Ch:=ReadKey; GotoXY(x,y); TextColor(0); Write('1'); Case Ch of #75: If x>10 then x:=x-1; #77: If x<60 then x:=x+1; #72: If y>10 then y:=y-1; #80: If y<20 then y:=y+1; End; delay(100); Until Ch=#27; ReadKey; END. |
Гость |
![]()
Сообщение
#3
|
Гость ![]() |
В догонку:[code] x:=10; y:=10; x1:=random(49)+10; y1:=random(9)+10; GotoXY(x1,y1); TextColor(15); Write('1'); Repeat If (x=x1) AND (y=y1) Then Begin GotoXY(43,5); TextColor(15); Write('+100'); x1:=random(49)+10; y1:=random(9)+10; GotoXY(x1,y1); как "Злого Смайла" заставить двигаться,покая его не сьел?)))) |
![]() ![]() |
![]() |
Текстовая версия | 20.06.2025 22:00 |