Data Types
StarLogo supports only a few data types:
boolean, dlist, ilist, number, and
symbol .
- Whenever you need to run a list of commands (i.e. if
xcor > 0 [fd 50]), you use an ilist. ilists cannot
be created at runtime like dlists; they must be written between
[ ] 's in your code. All values inside an ilist
are evaluated.
- In StarLogo, numbers have a range that is
determined by the version of Java that you are using. In Sun's Java
this ranges from approximately -1*10^300 to 1*10^300, and decimals can
go down to about 1*10^-300. Values smaller than 1*10^-300 return a value
of 0, and values larger than 1*10^300 return a value of "Infinity".
- symbols are used to refer to filenames and
other strings. symbols are written as a string with a quotation
mark " at the beginning and the end (i.e. "foo"
or "myfile.txt").
|