in reply to The interesting problem of cookie dough placement.

so what, no intelligent thoughts in this thread? i'd like to read them..

i'm forced to express my sparse thoughts: tessellation? hexagonal tessellation? the cookie is in the center of the tile (the space between cookie can be taken in count), start from the center of the baking sheet and fill the whole. I'm not able to do this.
Another idea was related with figurative numbers but it is only worth to investigate for square baking sheets, not so frequent and the OP specified a rectangular shapes. You can enjoy figurative numbers in the Tartaglia's triangle.

Then i tried something with Text::Wrap with no brillant results.

Obviously you can think about cookies as an AoA and try to approximate the max row lenght and how many rows you'll need. you can even consider an element less for every even row to displace them in a diagonal like structure. But i think is a shaggy task of (square?) recursive approximations.

Or you can do as we do at home for cookies: place as they go and two or more waves of cooking!

L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: The interesting problem of cookie dough placement.
by BrowserUk (Patriarch) on Mar 11, 2015 at 22:44 UTC

    You're rushing things! :)

    My first approach was:

    1. Randomly position N dots on the tray.
    2. Grow them in parallel, in steps, until one of them touches something -- an edge or another cookie.
    3. Move them half way into any adjacent space. Outer ones first towards the nearest edge(s). Inner ones toward the 'new edge' formed by a box 'drawn' inside the outer ones.
    4. goto step 2 if any of them are not touching in (at least) 4 places.
    5. end.

    But, a) it is a pain to program; b) it runs like a dog.

    My thoughts so far are summed up in this image.

    • A diamond pattern is never the right answer.

      Unless you want to make exactly 5 cookies.

      Despite that TV chef's seem to use it exclusively!

      Of course, it could be that their practiced eyes are actually doing a honeycomb arrangement -- whether they know it or not -- and it is just my observation that it looks more like a diamond pattern.

    • Despite the literature, a grid arrangement is the most efficient for any square, or tending to square tray.
    • With honeycomb arrangements, it is important that you go for long/short/long(...) when odd numbers of long-edge aligned rows are required.
    • The choice between grid and honeycomb depends upon the ratio of the sides.
    • There are at least 6 different ratio break points.
    • A table-driven lookup of the ratios to arrangements is probably the best/simplest selection mechanism.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked