6
Write a program that prints the shapes of one-sided polyominoes.
Given input 4 (tetrominos), a sample output would be:
* * * *
* * ** ** ** *
** ** ** * * *** ****
You are not restricted with respect to orientation, ordering or layout as long as polyominoes are not connected and not duplicated. (E.g. you can print the shapes in a column rather than a row)
Provide code that inputs a number from 3 to 6 and outputs the one-sided polyominoes of that size. The expected number of polyominoes output are 2, 7, 18, and 60 for 3, 4, 5, and 6 as inputs respectively.
Shortest code wins, present your solution for number 4.
I'm a little confused. The goal is a program that can print all triominos through all hexominos? – Casey – 2011-04-24T19:25:34.880
Actually you need to write program that takes number and outputs all polyominoes of that number. – ralu – 2011-04-24T20:02:17.063
1@ralu Could you please clarify that in your post? The "Provide code that accepts number from 3 to 6 and displays proper polyomino" bit makes it seem like you only want triominos-hexominos. – Casey – 2011-04-24T20:12:51.843
1You forgot the T tetromino. I take it you mean "one-sided" polyominos? – Keith Randall – 2011-04-24T21:38:42.563
It's polyominoes, not polynomials :D – Lowjacker – 2011-04-25T21:39:44.667
@Lowjacker, oops. Mea culpa. Guess which of the two words I type more frequently... – Peter Taylor – 2011-04-26T05:58:57.750