Someone want to make an i_rectangles.cfdg?

Here you can discuss and share functionality improvements and helper programs to make Context Free better.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
User avatar
chris
Site Admin
Posts: 72
Joined: Wed May 04, 2005 10:57 am
Location: New York, NY
Contact:

Someone want to make an i_rectangles.cfdg?

Post by chris »

It would be a pretty quick perl/python/whatever script. (or you could use my C++ if you want to borrow my code from the i_curves.cfdg and i_polygons.cfdg generators).

I just think it would be cool to say:

rectangle3by17 {}

and have that draw something appropriate. I'm indifferent to the scaling, whether that would be the same size as 51 squares, or fit into the same space as one square.

By the way, it would be awesome if the program were optimized with self-references and large squares, whenever possible, like this:

rule rectangle2by6{
SQUARE {size 2 x -2}
SQUARE {size 2 x}
SQUARE {size 2 x 2}
}

rule rectangle6by2 {
rectangle2by6 {rotate 180}
}

rule rectangle12by4 {
rectangle2by6 {size 2}
}


Things to keep in mind:
-it should be centered in the middle, I think
-each shape should be drawn with as few squares as possible, to make drawing as fast as possible.

Anyway, it'd be cool if someone did it. I'd love to be able to draw line segments easily.

-cc
Current Project: I'm creative director of OKCUPID at http://www.okcupid.com

User avatar
chris
Site Admin
Posts: 72
Joined: Wed May 04, 2005 10:57 am
Location: New York, NY
Contact:

Post by chris »

This is moot now, with the new separate X and Y sizing.

cc
Current Project: I'm creative director of OKCUPID at http://www.okcupid.com

Post Reply