Questions tagged [packing]

For challenges regarding fitting the most number of a certain shape into another shape, or for packing a number of a certain shape into the most compact form.

19
votes
2answers
401 views

Find the area of the smallest rectangle to contain squares of sizes up to n

This is a sequence question of the usual type, as applied to OEIS sequence A038666. That is, do either of the following: Accept no or any input, and output A038666 until the heat death of the ...
8
votes
1answer
370 views

Tiling the unit square

Background By expanding and cancelling terms, it is easy to show the following identity: However, it is an open problem whether all 1/n-by-1/(n+1) rectangles can tile the unit square. The Task ...
26
votes
19answers
1k views

ASCII Bookshelves

You know those stackable shelves that are basically just wooden boxes that can be stacked together? We're going to simulate building some bookshelves out of those with some ASCII art. Our books are ...
7
votes
2answers
320 views

Do the figures fit?

Challenge Make the shortest program to determine if the figures in the input will fit into the space in the input. Requirements The input will be in the format of this example: Input: ...
7
votes
1answer
175 views

Compute the polyomino capacity of a rectangle

Write a program or function that takes as input three positive integers x, y, and a and ...
21
votes
1answer
665 views

Packing Circles

Take a look at this image. Specifically, at how the holes on the ends are arranged. (Image source) Notice how the pipes in this image are packed in a hexagonal pattern. It is known that in 2D, a ...
23
votes
3answers
2k views

Stacking Pythagorean Triangles

Background A Pythagorean triangle is a right triangle where each side length is an integer (that is, the side lengths form a Pythagorean triple): Using the sides of this triangle, we can attach two ...
20
votes
2answers
949 views

Worst Case Manhattan Exclusion

Imagine a W by H grid of squares that wraps toroidally. Items are placed onto the grid as follows. The first item can be placed on any square, but subsequent items must not be within a Manhattan ...
14
votes
4answers
414 views

Packing Wood Pieces

There are two pieces of wood. Both consist of a straight body and some extra blocks below the body. An example piece with extra blocks at (0-indexed) positions 0,4,7,9,10: ...
14
votes
1answer
278 views

Finding Symmetries in Squares

Write a program or function that takes in a list of positive integers. Each of these integers represents the side length of a square on a 2D plane. Each square can be moved to any integer coordinates ...
12
votes
0answers
1k views

Tetris Tangrams

Introduction Tangrams are a classic puzzle involving arranging/fitting blocks into various shapes. From the Chinese 七巧板 - literally meaning "seven boards of skill". Let's take this idea and use the ...
14
votes
1answer
462 views

Robot roadie needed to pack the truck

As the band's roadie, you have to pack the truck. Your program will place the packages so that they fit in the smallest height. A badly packed truck Rules Packages may be rotated through multiples ...
8
votes
1answer
2k views

Circle packing in a rectangle

Your task is to write a program that finds the largest radius that N circles can have and still fit inside of a rectangle that is X by Y pixels large. (similar to this wikipedia article) Your program ...
7
votes
1answer
3k views

Solve a Tetris Puzzle (pack predefined shapes into optimal form)

The challenge is about finding an optimal solution on how to place a number of given shapes. It is oriented on the principle of Tetris, where it is optimal to pack the given pieces as tight as ...
6
votes
2answers
297 views

Eco-ize data for printing

Inspired by ecofont. Given a string containing # and , output it more eco-friendly by cutting out circles, while keeping it "...