Created
June 8, 2021 09:52
-
-
Save pencelab/8db3c20e9828adb374cc1723c806bebf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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