Skip to content

Instantly share code, notes, and snippets.

@pencelab
Last active May 15, 2021 07:56
Show Gist options
  • Save pencelab/bc0713324fa981e5639934e74592e4ed to your computer and use it in GitHub Desktop.
Save pencelab/bc0713324fa981e5639934e74592e4ed to your computer and use it in GitHub Desktop.
panel {
val square = square {
lines = 8
char = 'd'
}
addShape(Space)
val triangle = triangle {
lines = 7
char = 's'
}
val rhombus = Rhombus(11, 'l')
addShape(Space)
addShape(rhombus)
addShape(Space)
addShape(
ComposedShape(square, rhombus, ComposedShape.Operation.UNION)
)
addShape(Space)
addShape(
ComposedShape(rhombus, triangle, ComposedShape.Operation.UNION)
)
addShape(Space)
addShape(
ComposedShape(square, rhombus, ComposedShape.Operation.INTERSECTION)
)
addShape(Space)
addShape(
ComposedShape(rhombus, triangle, ComposedShape.Operation.INTERSECTION)
)
addShape(Space)
addShape(
ComposedShape(
ComposedShape(square, rhombus, ComposedShape.Operation.UNION),
triangle,
ComposedShape.Operation.UNION
)
)
addShape(Space)
addShape(
ComposedShape(
ComposedShape(square, rhombus, ComposedShape.Operation.INTERSECTION),
triangle,
ComposedShape.Operation.INTERSECTION
)
)
}.print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment