Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'One Sided Polyomino Generation' topicStudent Support Forum > General > "One Sided Polyomino Generation"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Bill Simpson
09/26/12 1:21pm

Here is a start at your task.

In the notebook you gave

down near the very bottom delete this
---
Manipulate[GraphicsGrid[Partition[Join[Graphics[Sq[#, 1] & /@ #, ImageSize -> {50, 50}] & /@ shapes[numberOfSquares - 1], Table[Graphics[{White}], {60 - Length[shapes[numberOfSquares - 1]]}]], 10], Frame -> All], {{numberOfSquares, 3, "number of squares"}, {3, 4, 5, 6}}, SaveDefinitions -> True]
---
and instead substitute this
---
numberOfSquares = 5;
g = Graphics[Sq[#, 1] & /@ #, ImageSize -> {50, 50}] & /@ shapes[numberOfSquares - 1];
For[i = 1, i ≤ Length[g], i++,
Export[ToString[i] <> ".jpg", g[[i]]]
]
---
That gets rid of the on screen presentation of the result and just generates a set of image files.

I am guessing that you don't actually want image files.

If you trim it down to just
---
numberOfSquares = 5;
p= {Sq[#, 1] & /@ #} & /@ shapes[numberOfSquares - 1]
---
then you get a list of polygons and you can look up the help page for Polygon to understand how the verticies. You might be able to learn enough to write code to translate Polygon into the form of data that you actually want.

URL: ,

Subject (listing for 'One Sided Polyomino Generation')
Author Date Posted
One Sided Polyomino Generation Daniel Wieder 09/26/12 10:05am
Re: One Sided Polyomino Generation Bill Simpson 09/26/12 1:21pm
Re: Re: One Sided Polyomino Generation Daniel Wieder 09/26/12 5:30pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic