Thanks to @caprycorn for inspiration from his project "Squares drawer" https://scratch.mit.edu/projects/219862764/#player