本节是关于 CGA 特性的,涵盖了典型的结构、CGA 语法和方便的特性。形状操作概述中介绍了 CGA 操作。

带参数的规则

将多个字符串、数字或布尔值从规则传递给其后继者。

条件规则

根据条件调用不同的后继规则。

随机规则

随机调用不同的后继规则。每个继任者的可能性可以通过百分比来控制。

CGA 属性

用于在多个规则中存储值的全局变量。它们可以在规则文件或Inspector中修改。

CGA 风格

样式是一组属性值的特定组合。您可以在Inspector中切换样式 。

CGA 函数

封装代码,以便它可以被多个规则使用。有助于避免重复代码。

局部变量

将中间值存储在局部变量中。

规则文件导入

导入规则文件以访问其所有规则、函数和属性。

注释

让您的同行程序员(或未来的您自己)更容易理解您的代码。

 

 

 

This section is about CGA Features and covers typical constructs, CGA syntax and handy features. CGA Operations are covered in Shape operations overview.

Rule with parameters

Pass multiple strings, numbers or boolean values from a rule to its successors.

Conditional rule

Call different successor rules based on conditions.

Stochastic rule

Call different successor rules at random. The likelihood of each successor can be controlled by percentages.

CGA attributes

Global variables used to store values in multiple rules. They can be modified in the rule file or the Inspector.

CGA styles

A style is a specific combination of values for a set of attributes. You can switch between styles in the Inspector.

CGA functions

Encapsulate code so that it can be used by multiple rules. Helps to avoid duplicated code.

Local variables

Store intermediate values in local variables.

Rule file import

Import rule files to get access to all of its rules, functions, and attributes.

Comments

Make your code easier to understand for your peer programmers (or yourself in the future).