L-seed-0.2: Plant growing programming game

Lseed.Logic

Description

This module is mostly a general dump...

Synopsis

Documentation

lightAngle :: Double -> AngleSource

Given the fraction of the time passed, returnes the angle of the sunlight

remainingGrowth :: (a -> GrowthState) -> Planted a -> DoubleSource

Calculates the length to be grown

growGarden :: RandomGen g => Angle -> g -> GrowingGarden -> Double -> GrowingGardenSource

For a GrowingGarden, calculates the current amount of light and then advance the growth. This ought to be called after applyGenome

applyGenome :: RandomGen g => Angle -> g -> GrowingGarden -> [(GrowingPlanted, [Double])]Source

For all Growing plants that are done, find out the next step If new plants are to be created, these are returned via their position, next to their parent plant.

growPlanted :: GrowingPlanted -> Double -> Double -> GrowingPlantedSource

Applies an L-System to a Plant, putting the new length in the additional information field

applyGrowth :: Double -> GrowingPlanted -> GrowingPlantedSource

Applies Growth at given fraction, leaving the target length in place