MCVSM RandomCity MiscellaneousC ºýB RandomCitygClick to insert.7Ý  ;¿82 %$ ´Wú| S S  Ì Ì$  ùùùùùùùùùùùùùùùùùùùùùùìììùùìììùùìììùùùùùùùùùùùùùùùùùùùùùù€€€ü@@@@C„C„C„@@@@üÆ ß ø  *Etagen8Ecken5Radius_GrundflŠche50 RandomizeTrue KlebelaschenTruePROCEDURE RandomCity; VAR Ecken, etagen, i, k:INTEGER; Radius, Kleblaschen, Abstand, Hšhe, breite1, breite2:REAL; { == N-ECK GRUNDFL€CHE == } PROCEDURE GrundflŠche(r:REAL;i:INTEGER); VAR k:INTEGER; BEGIN ClosePoly; BeginPoly; MoveTo(r*cos(Pi/i), r*sin(Pi/i)); FOR k:= 1 TO i-1 DO LineTo(r*cos(2*Pi*(k+0.5)/i), r*sin(2*Pi*(k+0.5)/i)); EndPoly; END; { == WANDFL€CHEN == } PROCEDURE WŠnde(Angle, Abstand, Hšhe, x1, x2:REAL); BEGIN BeginPoly; IF (PKlebelaschen=true) THEN BEGIN MoveTo(cos(Angle)*(Abstand+Hšhe) + cos(Angle+pi/2)*x2 , sin(Angle)*(Abstand+Hšhe) + sin(Angle+pi/2)*x2); LineTo(cos(Angle)*(Abstand+Hšhe-Kleblaschen) + cos(Angle+pi/2)*(x2+Kleblaschen-(Kleblaschen*(x2-x1)/Hšhe)) , (Abstand+Hšhe-Kleblaschen-(Kleblaschen*(x2-x1)/Hšhe))*sin(Angle)+(x2+ Kleblaschen)*sin(Angle+pi/2)); LineTo(cos(Angle)*(Abstand+Kleblaschen) + cos(Angle+pi/2)*(x1+Kleblaschen+(Kleblaschen*(x2-x1)/Abstand)) , (Abstand+Kleblaschen)*sin(Angle)+(x1+Kleblaschen+(Kleblaschen*(x2-x1)/Hšhe))*sin(Angle+pi/2)); LineTo(cos(Angle)* Abstand + cos(Angle+pi/2)*x1 , Abstand *sin(Angle) + x1*sin(Angle+pi/2)); LineTo(cos(Angle)*(Abstand+Hšhe) + cos(Angle+pi/2)*x2 , (Abstand+Hšhe)*sin(Angle) + x2*sin(Angle+pi/2)); LineTo(cos(Angle)*(Abstand+Hšhe) - cos(Angle+pi/2)*x2 , (Abstand+Hšhe)*sin(Angle) - x2*sin(Angle+pi/2)); LineTo(cos(Angle)* Abstand - x1*cos(Angle+pi/2) , Abstand*sin(Angle) - x1*sin(Angle+pi/2)); END ELSE BEGIN MoveTo(cos(Angle)*(Abstand+Hšhe) + cos(Angle+pi/2)*x2 , sin(Angle)*(Abstand+Hšhe) + sin(Angle+pi/2)*x2); LineTo(cos(Angle)* Abstand + cos(Angle+pi/2)*x1 , Abstand*sin(Angle) + x1*sin(Angle+pi/2)); LineTo(cos(Angle)*(Abstand+Hšhe) + cos(Angle+pi/2)*x2 , (Abstand + Hšhe)*sin(Angle)+x2*sin(Angle+pi/2)); LineTo(cos(Angle)*(Abstand+Hšhe) - cos(Angle+pi/2)*x2 , (Abstand + Hšhe)*sin(Angle)-x2*sin(Angle+pi/2)); LineTo(cos(Angle)* Abstand - x1*cos(Angle+pi/2) , Abstand *sin(Angle)-x1*sin(Angle+pi/2)); END; EndPoly; END; { == EIGENTLICHE PROCEDUR == } BEGIN IF (PRandomize=true) THEN BEGIN Ecken:=3+RANDOM*5; Radius:=20+RANDOM*50; etagen:=1+RANDOM*10; END ELSE BEGIN Ecken:=PEcken; Radius:=PRadius_GrundflŠche; etagen:=1+PEtagen; END; Kleblaschen:=5; breite2:=0; Abstand:=Radius*cos(Pi/Ecken); GrundflŠche(Radius, Ecken); OpenPoly; FOR i:= 2 TO Etagen DO BEGIN breite1:= breite2; breite2:= random*40-20; Hšhe:= 10+random*50; FOR k:=1 TO Ecken DO BEGIN WŠnde(2*k*Pi/Ecken, Abstand, Hšhe, (Radius*2*sin(Pi/Ecken)+breite1)/2, (Radius*2*sin(Pi/Ecken)+breite2)/2); END; Abstand:=Abstand+Hšhe; END; END; RUN(RandomCity);