Early note: This is not homework.  I simply regularly create ideas in an attempt to teach myself a language.  For what it's worth I'll be using Javascript for this.That said, I haven't been able to come up with a solution/algorithm outside of brute force.  I've searched for various puzzle algorithms but any assumptions regarding puzzle shapes don't fit my simpler criteria so become overly complicated quickly.  I'm calling this a rectangle puzzle rather than a jigsaw puzzle since there is no final picture or restrictions on the overall placement of the pieces.There are only 4 possible piece shapes (row x column) : 1x2, 2x1, 2x2, 4x1These are the only pieces (ie. they may not be rotated or overlap)The play area is 8x4The number of pieces will be undetermined at startPieces may exist multiple times or not at allThe play area does not need to be completely filledThe only requirement regarding placement is they must fit in the play areaThere is no one solutionEnd solution: What I would like to output is the various arrangements that exist.  In other words, given a set of pieces I'd like to know in what ways they may populate the game area.  Given the pieces available among other constraints there will be a finite set of solutions.For the visually minded please see the images.Play AreaPossible PiecesGenerating a 2D array and fitting the pieces via brute force, as said, is possible but I'd prefer to know whether this is already a game of sorts and an algorithm exists.  I'm not a math lover so I'm not familiar with any possible solutions that may exist in that space but wouldn't be against investigating if something makes sense.
Algorithm for solving rectangle puzzle
algorithms;arrays