Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pencelab/8db3c20e9828adb374cc1723c806bebf to your computer and use it in GitHub Desktop.
Save pencelab/8db3c20e9828adb374cc1723c806bebf to your computer and use it in GitHub Desktop.
panel {
val shapes = mutableListOf<Shape>()
repeat(5) {
shapes.add(when ((1..3).random()) {
1 -> square {
lines = 5
char = 'a' + it
}
2 -> triangle {
lines = 5
char = 'a' + it
}
else -> rhombus {
lines = 5
char = 'a' + it
}
})
space()
}
composed {
shapes.reduce { composedShape, shape ->
if (Random.nextBoolean()) composedShape intersection shape else shape intersection composedShape
} as ComposedShape
}
}.print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment