L-seed-0.2: Plant growing programming game

Lseed.Geometry

Synopsis

Documentation

crossPoint :: Line -> Line -> Maybe PointSource

from http:www.pdas.com/lineint.htm

gardenToLines :: Garden a -> [(Line, a)]Source

Lines are annotated with its plant, identified by the extra data

lightenLines :: Double -> [(Line, a)] -> [(Line, a, Double)]Source

Add lightning from a given angle

allKindsOfStuffWithAngle :: forall a. Double -> [(Line, a)] -> ([(Line, a, Double)], [(Point, Point, Point, Point, Double)])Source

lightenGarden :: Angle -> Garden a -> Garden (a, Double)Source

Annotates each piece of the garden with the amount of line it attacts

mapLine :: (forall b. [(Line, b)] -> [(Line, b, c)]) -> c -> (c -> c -> c) -> Garden a -> Garden (a, c)Source

Helper to apply a function that works on lines to a garden

gardenOffset :: AnnotatedGarden -> (Double, Double, Double)Source

Slightly shifts angles

For a Garden, calculates the maximum size to the left, to the right, and maximum height