With the shell script, using cfdgpp instead of cfdg to compile your CFDG scripts will automatically preprocess them with the C preprocessor. You can thus write:
Code: Select all
startshape sun
#define SUN(A) rule sun { A * { r (360/A) } ray { h 0 b 1 sat 1 |h 60 } }
SUN(5)
SUN(6)
SUN(7)
SUN(8)
SUN(9)
SUN(10)
rule ray {
CIRCLE { }
ray { y .1 r 1 s .965 h .05| }
}
rule ray 0.15 {
ray { flip 90 }
}
Code: Select all
startshape sun
rule sun { 5 * { r (360/5) } ray { h 0 b 1 sat 1 |h 60 } }
rule sun { 6 * { r (360/6) } ray { h 0 b 1 sat 1 |h 60 } }
rule sun { 7 * { r (360/7) } ray { h 0 b 1 sat 1 |h 60 } }
rule sun { 8 * { r (360/8) } ray { h 0 b 1 sat 1 |h 60 } }
rule sun { 9 * { r (360/9) } ray { h 0 b 1 sat 1 |h 60 } }
rule sun { 10 * { r (360/10) } ray { h 0 b 1 sat 1 |h 60 } }
rule ray {
CIRCLE { }
ray { y .1 r 1 s .965 h .05| }
}
rule ray 0.15 {
ray { flip 90 }
}
Any bug reports/comments/ideas for improvements are greatly appreciated as always. Enjoy!