Answer the question
In order to leave comments, you need to log in
Fill the screen with cells without cycles while maintaining the shape of a rectangle?
The task was to fill the screen with cells, and at the same time, the resulting rectangle should completely fit into it, retaining its shape, as here:
And at the same time avoid situations when there are fewer cells in the last row: I
wrote code for this case , but sometimes the cells are still are transferred (I think because when resizing the screen width may not be divisible by 10, and looking for a suitable cell size, we reduce it by 0.01). Is it possible to do the math in such a way that the above conditions are met, and at the same time the code does not use loops to select the appropriate cell size, and is it possible to find it at any screen resolution? Am I approaching the problem in the right way?
Answer the question
In order to leave comments, you need to log in
Factoring the number of cells into factors of 1000 = 2 * 2 * 2 * 5 * 5 * 5
1000 cells can be represented as a limited number of rectangles:
2 * 500
4 * 250
5 * 200
8 * 125
10 * 100
20 * 50
25 * 40
and mirrored. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question