function RectangleInit(TRectangle gene) { gene.x = random(0, 255); gene.y = random(0, 255); gene.width = random(0, 255-x); gene.height = random(0, 255-y); }The above function, as implied from its name, is the gene initializer moderator for a gene of type TRectangle defined in the previous subsection. Assuming that there exists a library function called ``random'' which returns a random integer in the range specified by its two parameters, then this function randomly fills up all the members of a gene. An evident syntactic difference between C and DARWIN functions is that DARWIN functions are preceded by the keyword function.
The DARWIN language recognizes most of the C statements. Currently, DARWIN supports the C if conditional statement and the while and for looping constructs.
The DARWIN syntax allows most of the C expression syntax. Since DARWIN does not support pointer types, there is no vital need for type casting and pointer arithmetics together with support for referencing and de-referencing.
As a result, the DARWIN function definition syntax can be viewed as a subset of standard C. DARWIN is equipped with a sufficient set of operations that are present in any iterative language and the DARWIN expressions are powerful enough to express any calculation.
The DARWIN functions follow closely the C language semantics. The only major difference is in the function parameter passing semantics. In DARWIN all the parameter passing is done by reference. This is a direct consequence of not supporting pointer types. All the other DARWIN constructs obey their C equivalent semantics.