admin
|
|
« Odpowiedz #2 : Styczeñ 09, 2012, 08:14:40 » |
|
Przyk³ad 4. Proszê napisaæ program który prosi o podanie wyrazu (s³owa). Nastêpnie wy¶wietla w jednym miejscu "literê po literze" (kolejne litery) podanego s³owa.
program miki; uses crt,dos; var x,y:byte; s:string; begin repeat clrscr; write('Podaj slowo: ');readln(s); x:=length(s); for y:=1 to x do begin gotoxy(40,10);write(s[y]);delay(500); end; until s='adam' end.
------------------------------- nowy program ------------------------------------- program vxr; uses crt,dos; var x,y:byte; procedure znaczek; begin textbackground(blue);textcolor(white); gotoxy(x,y);write(' | '); gotoxy(x,y+1);write('---'); gotoxy(x,y+2);write(' | '); delay(1000);clrscr; end;
begin clrscr; randomize; repeat x:=1+random(57); y:=1+random(21); znaczek; until keypressed; readkey; end. __________________________ jeszcze jeden program ________________________
program vxr; uses crt,dos; var x,y:byte; procedure znaczek; var x,y:byte; begin textbackground(blue);textcolor(white); x:=1+random(57); y:=1+random(21); gotoxy(x,y);write(' | '); gotoxy(x,y+1);write('---'); gotoxy(x,y+2);write(' | ');
end; procedure znaczek1; var x,y:byte; begin textbackground(blue);textcolor(white); x:=1+random(57); y:=1+random(21); gotoxy(x,y);write(' | '); gotoxy(x,y+1);write('---'); gotoxy(x,y+2);write(' | ');
end;
procedure znaczek2; var x,y:byte; begin textbackground(blue);textcolor(white); x:=1+random(57); y:=1+random(21); gotoxy(x,y);write(' | '); gotoxy(x,y+1);write('---'); gotoxy(x,y+2);write(' | '); delay(500) end; begin clrscr; randomize; repeat znaczek; znaczek1;znaczek2; clrscr; until keypressed; readkey; end.
|