Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Math problem
#6
(05-04-2023, 11:05 AM)rich2005 Wrote:
(05-04-2023, 10:51 AM)Ofnuts Wrote: The number of complete celles is the integer division of the window width, minus the offset, by a "cell". Then you have to figure out what it on the left and what is on the right (wich depends on offset and space).

Well, that is what I did, except took the case where the offset = zero. Are you saying that is not equal to the general case as well ?

No because you have edge cases (literally and figuratively) where a good part of the grid is outside the window, which increases the size of the visible spaces. For instance, for a 5+2 pattern and a width of 23:
Code:
offset  0, total  17 ([5, 5, 5, 2])
offset  1, total  16 ([5, 5, 5, 1])
offset  2, total  15 ([5, 5, 5])     # 4 full lines showing
offset  3, total  16 ([1, 5, 5, 5])
offset  4, total  17 ([2, 5, 5, 5])
offset  5, total  17 ([3, 5, 5, 4])
offset  6, total  17 ([4, 5, 5, 3])

And this is a very practical problem, I need this to know in advance the size of a layer where I keep only the spaces.
Reply


Messages In This Thread
Math problem - by Ofnuts - 05-02-2023, 08:45 AM
RE: Math problem - by PixLab - 05-03-2023, 08:47 AM
RE: Math problem - by rich2005 - 05-03-2023, 10:17 AM
RE: Math problem - by Ofnuts - 05-04-2023, 10:51 AM
RE: Math problem - by rich2005 - 05-04-2023, 11:05 AM
RE: Math problem - by Ofnuts - 05-04-2023, 11:45 AM
RE: Math problem - by programmer_ceds - 05-04-2023, 05:33 PM
RE: Math problem - by rich2005 - 05-04-2023, 12:27 PM
RE: Math problem - by Ofnuts - 05-04-2023, 12:58 PM
RE: Math problem - by Ottia Tuota - 05-04-2023, 05:34 PM
RE: Math problem - by Ofnuts - 05-05-2023, 04:50 PM
RE: Math problem - by Ottia Tuota - 05-05-2023, 07:12 PM
RE: Math problem - by Ofnuts - 05-05-2023, 08:04 PM
RE: Math problem - by programmer_ceds - 05-05-2023, 09:53 PM
RE: Math problem - by Ofnuts - 05-05-2023, 10:54 PM
RE: Math problem - by Ottia Tuota - 05-06-2023, 08:23 AM
RE: Math problem - by programmer_ceds - 05-06-2023, 10:22 AM
RE: Math problem - by Ottia Tuota - 05-06-2023, 07:52 PM
RE: Math problem - by Ofnuts - 05-06-2023, 09:05 PM

Forum Jump: