i信息学奥赛

加入QQ群:1025629106,或关注微信公众号:i信息学奥赛,获取更多学习资源。

导航

可爱的小牛

Posted on 2016-12-10 16:50  shnoip  阅读(181)  评论(0编辑  收藏  举报

感谢明星学校许毓展同学提供
uses crt;
var
  x,y,i:byte;
  c:char;
procedure movel;
begin
  clrscr;
  gotoxy(x,y);
  writeln('            /~~~~~\        /~~~~~\');
  gotoxy(x,y+1);
  writeln('           |    (~','''','        ~~~)   |');
  gotoxy(x,y+2);
  writeln('            \    \__________/    / ');
  gotoxy(x,y+3);
  writeln(' /~~~~~~~-_ /~::::::::         ~\');
  gotoxy(x,y+4);
  writeln('\ ======= /| ::::::::             |_-~~~~~~~\     ');
  gotoxy(x,y+5);
  writeln('  ~-_____-~|  ::A::;       A     :|\ ====== /  ');
  gotoxy(x,y+6);
  writeln('           |  _----------------_::| ~-____-~');
  gotoxy(x,y+7);
  writeln('           |/~                  ~\|            ');
  gotoxy(x,y+8);
  writeln('           /                      \        ');
  gotoxy(x,y+9);
  writeln('          (        ()    ()        )    ');
  gotoxy(x,y+10);
  writeln('           `\                   ./','''');
  gotoxy(x,y+11);
  writeln('             ~-_______________-~ ');
  gotoxy(x,y+12);
  writeln('                    /~~~~\       ');
  gotoxy(x,y+13);
  writeln('                   |      |   ');
  gotoxy(x,y+14);
  writeln('                   |      |');
  gotoxy(x,y+15);
  writeln('                  (________)');
  gotoxy(x,y+16);
  writeln('                      ()');
end;
procedure mover;
begin
  clrscr;
  gotoxy(x,y);
  writeln('            /~~~~~\        /~~~~~\');
  gotoxy(x,y+1);
  writeln('           |    (~','''','        ~~~)   |');
  gotoxy(x,y+2);
  writeln('            \    \__________/    / ');
  gotoxy(x,y+3);
  writeln('            /~::::::::         ~\   _-~~~~~~~\');
  gotoxy(x,y+4);
  writeln(' /~~~~~~~-_| ::::::::             |\ ====== /     ');
  gotoxy(x,y+5);
  writeln('\ ======= /|  ::A::;       A     :|  ~-____-~  ');
  gotoxy(x,y+6);
  writeln(' ~-_____-~ |  _----------------_::|');
  gotoxy(x,y+7);
  writeln('           |/~                  ~\|            ');
  gotoxy(x,y+8);
  writeln('           /                      \        ');
  gotoxy(x,y+9);
  writeln('          (        ()    ()        )    ');
  gotoxy(x,y+10);
  writeln('           `\                   ./','''');
  gotoxy(x,y+11);
  writeln('             ~-_______________-~ ');
  gotoxy(x,y+12);
  writeln('                    /~~~~\       ');
  gotoxy(x,y+13);
  writeln('                   |      |   ');
  gotoxy(x,y+14);
  writeln('                   |      |');
  gotoxy(x,y+15);
  writeln('                  (________)');
  gotoxy(x,y+16);
  writeln('                      ()');
end;
procedure still;
begin
  clrscr;
  gotoxy(29,1);
  writeln('按A键动左耳,按D键动右耳');
  writeln;
  gotoxy(x,y);
  writeln('            /~~~~~\        /~~~~~\');
  gotoxy(x,y+1);
  writeln('           |    (~','''','        ~~~)   |');
  gotoxy(x,y+2);
  writeln('            \    \__________/    / ');
  gotoxy(x,y+3);
  writeln('            /~::::::::         ~\');
  gotoxy(x,y+4);
  writeln(' /~~~~~~~-_| ::::::::             |_-~~~~~~~\     ');
  gotoxy(x,y+5);
  writeln('\ ======= /|  ::A::;       A     :|\ ====== /  ');
  gotoxy(x,y+6);
  writeln(' ~-_____-~ |  _----------------_::| ~-____-~');
  gotoxy(x,y+7);
  writeln('           |/~                  ~\|            ');
  gotoxy(x,y+8);
  writeln('           /                      \        ');
  gotoxy(x,y+9);
  writeln('          (        ()    ()        )    ');
  gotoxy(x,y+10);
  writeln('           `\                   ./','''');
  gotoxy(x,y+11);
  writeln('             ~-_______________-~ ');
  gotoxy(x,y+12);
  writeln('                    /~~~~\       ');
  gotoxy(x,y+13);
  writeln('                   |      |   ');
  gotoxy(x,y+14);
  writeln('                   |      |');
  gotoxy(x,y+15);
  writeln('                  (________)');
  gotoxy(x,y+16);
  writeln('                      ()');
end;
procedure a;
begin
   still;
   delay(200);
   clrscr;
   movel;
   delay(300);
   still;
end;
procedure d;
begin
   still;
   delay(200);
   clrscr;
   mover;
   delay(300);
   still;
end;
begin
  cursoroff;
  x:=18;
  y:=4;
  still;
  while true do begin
    if keypressed then begin
      c:=readkey;
      if c='a' then a;
      if c='d' then d;
    end;
  end;
end.