Category:Evaldraw: Difference between revisions
Content deleted Content added
m →Builtins: add descriptions of builtins |
→Arrays: add struct section |
||
Line 56:
===Arrays===
Arrays that are power of two are wrapped, non power-of-two arrays set index zero if accessed out of bounds.
For example, if we define static xcoords[4]; and try to access xcoords[5] we the returned value is at index 5%4 which is xcoords[1].
===Structs===
Structs can be declared and be passed as function parameters.
A struct may doubles, arrays of doubles and other structs.
For example struct vec{x,y,z;}; defines a struct with 3 fields.
struct boid_t{ vec pos; vec dir; } defines a struct that contains substructs pos and dir.
===Pass by value or pass by ref===
|