program WalkingHuman; uses Graph, Crt; const u = 14; {Смещение земли} neck = 20; {Шея} ground = 392; {Уровень земли} step = 25; {Длина ступни} pause = 20000; {Задержка} stAng = pi/6; {Начальный угол} dfAng = pi/30; {Величина изменения угла} var gd, gm, ec:integer; {Графика} k: integer; {Смещение земли} vHand: integer; {Длина руки} vLeg: integer; {Длина ноги} vHead: integer; {Радиус головы} ang, stepAng, lapAng: real; {Углы} ascent: integer; {Подьем тела} shoulderX, shoulderY: integer;{Плечи} loinX, loinY: integer; {Пояс} lElbowX, lElbowY: integer; {Левый локоть} rElbowX, rElbowY: integer; {Правый локоть} rLapX, rLapY:integer; {Правое колено} lLapX, lLapY:integer; {Левое колено} lBrushX, lBrushY: integer; {Левая кисть} rBrushX, rBrushY: integer; {Правая кисть} lStepX, lStepY: integer; {Левая пятка} rStepX, rStepY: integer; {Правая пятка} lStep1X, lStep1Y: integer; {Левый носок} rStep1X, rStep1Y: integer; {Правый носок} procedure Earth(k:integer); {Рисование земли} var i:integer; begin Line(0, ground, GetMaxX, ground); for i:= 0 to 12 do Line(80*i - k, ground, 80*i - k, ground + 10); end; procedure Body (head, shoulderX, shoulderY, loinX, loinY: integer); begin Circle(shoulderX, shoulderY - neck - head, head); Line(shoulderX, shoulderY - neck, loinX, loinY); end; procedure Hand (shoulderX, shoulderY, elbowX, elbowY, brushX, brushY, vHend:integer); begin Line(shoulderX, shoulderY, elbowX, elbowY); Line(elbowX, elbowY, brushX, brushY); end; procedure Leg (loinX, loinY, lapX, lapY, stepX, stepY, vLeg, step1X, step1Y:integer; ang: real); begin Line(loinX, loinY, lapX, lapY); Line(lapX, lapY, stepX, stepY); end; begin {Инициализация графики} gd:= Detect; InitGraph(gd, gm, ' '); ec:= GraphResult; if ec <> grOk then begin Writeln('Ошибка инициализации', GraphErrorMsg(ec)); Halt; end; {Рисование} shoulderX:= 320; shoulderY:= 120; vHand:= 60; vLeg:= 80; loinX:= 320; loinY:= 230; vHead:= 30; repeat ang:= pi/2 + stAng; k:=0; while ang >= pi/3 do begin ang:= ang - dfAng; ascent:= round(10*cos(5*ang)); SetColor(white); Earth(k); Body(vHead, shoulderX, shoulderY - ascent, loinX, loinY - ascent); lElbowX:= round(shoulderX + vhand*cos(ang)); lElbowY:= round(shoulderY + vhand*sin(ang) ); rElbowX:= round(shoulderX + vhand*(-cos(ang-pi/30+pi/12))); rElbowY:= round(shoulderY + vhand*(sin(ang-pi/30+pi/12)) ); lBrushX:= round(shoulderX + 2*vhand*cos(ang-pi/30)); lBrushY:= round(shoulderY + 2*vhand*sin(ang-pi/30) ); rBrushX:= round(shoulderX + 2*vhand*(-cos(ang+pi/12))); rBrushY:= round(shoulderY + 2*vhand*(sin(ang+pi/12)) ); lLapX:= round(loinX + vLeg*(cos(ang-pi/30))); lLapY:= round(loinY + vLeg*(sin(ang-pi/30)) ); rLapX:= round(loinX + vLeg*(-cos(ang+pi/12))); rLapY:= round(loinY + vLeg*(sin(ang+pi/12)) ); lStepX:= round(loinX + 2*vLeg*(cos(ang))); lStepY:= round(loinY + 2*vLeg*(sin(ang)) ); rStepX:= round(loinX + 2*vLeg*(-cos(ang-pi/30+pi/12))); rStepY:= round(loinY + 2*vLeg*(sin(ang-pi/30+pi/12)) ); lStep1X:= round(loinX + 2*vLeg*(cos(ang-pi/30))); lStep1Y:= round(loinY + 2*vLeg*(sin(ang-pi/30)) ); rStep1X:= round(loinX + 2*vLeg*(-cos(ang+pi/12))); rStep1Y:= round(loinY + 2*vLeg*(sin(ang+pi/12))); Hand(shoulderX, shoulderY - ascent , lelbowX, lelbowY - ascent , lbrushX, lbrushY - ascent , vHand); Hand(shoulderX, shoulderY - ascent , relbowX, relbowY - ascent , rbrushX, rbrushY - ascent , vHand); Leg(loinX, loinY - ascent , lLapX, lLapY - ascent , lStepX, lStepY - ascent , lStep1X, lStep1Y - ascent, vLeg, ang); Leg(loinX, loinY - ascent , rLapX, rLapY - ascent , rStepX, rStepY - ascent , rStep1X, rStep1Y - ascent, vLeg, ang); Body(vHead, shoulderX, shoulderY - ascent, loinX, loinY - ascent); Line(rStepX, rStepY-ascent, rStep1X, rStep1Y-ascent); Line(lStepX, lStepY-ascent, lStep1X, lStep1Y-ascent); delay(pause); SetColor(Black); Line(rStepX, rStepY-ascent, rStep1X, rStep1Y-ascent); Line(lStepX, lStepY-ascent, lStep1X, lStep1Y-ascent); Hand(shoulderX, shoulderY - ascent , lelbowX, lelbowY - ascent , lbrushX, lbrushY - ascent , vHand); Hand(shoulderX, shoulderY - ascent , relbowX, relbowY - ascent , rbrushX, rbrushY - ascent , vHand); Leg(loinX, loinY - ascent , lLapX, lLapY - ascent , lStepX, lStepY - ascent , lStep1X, lStep1Y - ascent, vLeg, ang); Leg(loinX, loinY - ascent , rLapX, rLapY - ascent , rStepX, rStepY - ascent , rStep1X, rStep1Y - ascent, vLeg, ang); Body(vHead, shoulderX, shoulderY - ascent, loinX, loinY - ascent); Earth(k); k:= k + u; end; until keypressed; ReadLn; CloseGraph; end.