our# ShapeServer DSL
From the stack app root use:
stack ghci
main
If any changes are made to the file then within stack ghci
just use :r
to reload the files before running main
again.
A Drawing is a list of the triple (Transform, Shape, Style)
Identity
: Does nothing to transform the shapeTranslate (Vector Double Double)
: Translates the object according to the vector in the x and y directionScale (Vector Double Double
: Scales the object according to the vector in the x and y directionRotate Double
: Rotates the object about the originCompose Transform Transform
: Allows the user to use multipleTransforms
The input box takes in shapes that are either a Circle
or a Square
.
The input box takes in shapes that are either a Circle
or a Square
.
Style is in the form of Style Colour Colour Double
. Colours
can be either Red, Blue, Green, Black or White
The first Colour
is the strokeColour
The second Colour
is the fillColour
The Double
is the strokeWidth
The sample input already in the text box produces the following shape
[((Compose (Translate (Vector 100.0 0.0)) (Scale (Vector 1.1 1.1))), Circle, (Style Black Blue 2.0)), (Identity, Square, (Style Red Green 5.0))]