Every Context-Free drawing, or CDFG for short, is comprised of one or more "rules" dictating what to do. To tell which rule to start with, we use "startshape". Let me show you with a couple of examples, and explain from there. You can even copy this over to CF and hit "Render" just so you can make your first CDFGs :) .

starshape ci

rule ci { CIRCLE{} }

rule ci { CIRCLE{} }

startshape sq

rule sq { SQUARE{} }

rule sq { SQUARE{} }

These two examples are the most basic CDFGs, a square and a circle. Each CDFG needs at least one rule, because you need to draw

Confused? Let me try to explain: we are telling CF start the shape with ci. Then we are telling it, create a rule, name it ci, and whenever you want to do ci, draw a circle.

lets do some more with this.

startshape cf

rule cf { SQUARE{} CIRCLE{x 2} }

rule cf { SQUARE{} CIRCLE{x 2} }

Lets dissect that, we now have a rule which has 2 shapes in it, one with "x 2" in its brackets. Render it. Notice that the circle is now to the right of the square. And the space between the two is exactly the same size they are. Change the 2 to a 1. Change the x to a y. Are you getting it? You can also mix the two, as well as use negative numbers to go the opposite direction. The descriptions inside the brackets change how you draw the rule. Notice that x goes right and y goes up. Easiest way for me to remember this is to stick out my left hand, palm facing away from me. The direction my fingers and thumb point are upwards for the numbers, so up for y and to the right for x.

Now we are gonna move on to a bigger step:

startshape ab

rule ab

{

CIRCLE{}

cd{x 1 size .5}

}

rule cd

{

SQUARE{}

ef{x 1 size .5}

}

rule ef

{

CIRCLE{}

}

rule ab

{

CIRCLE{}

cd{x 1 size .5}

}

rule cd

{

SQUARE{}

ef{x 1 size .5}

}

rule ef

{

CIRCLE{}

}

For the final part, you do it yourself. Create a shape, a new one. You will then need a rule. Have the rule draw either a circle or square (which is always capitalized). Move the circle or square in any direction by .2, and scale it by .995 . Finish the rule by having it call itself. Render it. You should end up with a tapering line. Notice how CF automatically rescales the image. Also, note what you would think would happen if you didnt scale the shape. CF keeps going until its working with such tiny pieces that they wont show up compared to the larger parts of the image. So if you did not rescale it, CF would keep drawing, forever adding to an infinitly long line. I chose the numbers .2 and .995 because they create a long smooth line, too large of an X and it gets bumpy (

One last modifier for you: brightness, back from before color. Expirament with it on how to make things brighter or darker, ok? You're at the point where you can self-teach. I have faith in you.

Final note: CF now offers 2 dimensional scaling. Following s or size, you can have 2 numbers, with a space between the two. They can scale the image in the x and y independantly. This means "size 2 .5" would make the next rule twice as long and half the height. It would show up with the height a quarter the size of the width, because the width is doubled and the height halved.