Context Free Art

Loops

From Context Free Art

Jump to: navigation, search

Loop Extensions

Loops in Context Free v2.1 can only contain one shape in the loop body. With loops extensions the loop body can contain multiple shapes and even nested loops.
startshape grid
 
rule grid {
    10* {y 1} {
        10* {x 1} shape {}
    }
}
 
rule shape { CIRCLE {}}
rule shape { SQUARE {}}
rule shape { 
    TRIANGLE {s cos(30)}
    TRIANGLE {r 180 s cos(30)}
}
Functionally this can all be done with simple loops by creating rules for the body of the loop. The advantage of extended loops is that the designer is not forced to create rules for loop bodies. The designer has the flexibility to put the loop body in another rule or right there in the containing rule.
Views
Personal tools
Navigation
Toolbox
MediaWiki
Attribution-Share Alike 2.5
book coverSee our new book:
Community of Variation