module Crate(float step);


public class CREATE extends Box
{
	public CREATE ()
	{ // Konstruktor
		setWidth(0.1)
		;
	}
	public CREATE(float width, float height)
	{
		setWidth(width);
		setHeight(height);
	}
	public CREATE(float width, float height, float length)
	{
		setWidth(width);
		setHeight(height);
		setLength(length);
	}
}
//	Crate
//	Skalierung
float U = 20 ;	// Breite
float V = 10 ;	// Dicke
float W = 2.5 ;	// Länge
// 	Abstand der Gebäude
int l1 = 60 ;
int l2 = -60 ;
//	Frequenz
float von = 1.5 ;
float bis = -1.5 ;
//	Drehung
float Drehung = .1 ;
//	Einstellungen
int AnzahlTürme = 2 ;
int AnzahlGebäude = 5 ;
     


protected void init ()
[
	Axiom ==> 
	Mark
	for((1:AnzahlGebäude))
	(
		[
			for((1:AnzahlTürme))
			(
				[
					for((1:1))
					(
						[
							
							[RH(random(-40,40))	Crate  ]
		
						]
					)
				]
			)
		]
		
		//	Positionierung Türme
		if (probability(0.33))
		(
			RH(90)
			RL(90)
			M(l1)
			RL(-90)
		)
		else if (probability(0.33))
		(
			RH(-90)
			RL(90)
			M(l1)
			RL(-90)
		)
		else if (probability(0.33))
		(
			RH(120)
			RL(90)
			M(l1)
			RL(-90)
		)
		
		//	Positionierung Gebäude
		if (probability(0.33))
		(
			RH(random(90,90))
			RU(90)
			M(l2)
			RU(-90)
		)
		
		if (probability(0.33))
		(
			RH(random(-90,90))
			RU(90)
			M(l2)
			RU(-90)
		)
		
		if (probability(0.33))
		(
			RH(random(120,90))
			RU(90)
			M(l2)
			RU(-90)
		)
		
	)
	;
]

public void build()
[
	Crate ==> //	CREATE
	CREATE(U,V,W)
	
	;
	
	//	###############################
	CREATE ==>
	{	//	JAVA
		//	CREATE
		U *= 1.0001 ;
		V *= 1.0001 ;
		W *= 1 ;
	}
	for ((1:2))
		(
			CREATE(U*random(1,1),V*random(1,1),W)
			RL(random(von,bis))
			RH(Drehung)
		
	//		Null(U/2,0,-W/2)
			
			CREATE(U,V,W*random(.5,2))
			RL(random(von,bis))
			RH(Drehung)
		)
	;
]
