home *** CD-ROM | disk | FTP | other *** search
-
- TABLE 5: The initialisation & screen set-up Library
-
-
- Note: the system variables sux & suy hold the CA universe width & height; you may find these useful when setting up the screen.
-
-
- Name of Procedure/Function Purpose
-
- PROCsoup(s%,n%,p) fills the automaton universe randomly with colours whose actual values range from
- s% to s%+n%-1; note, these values are as stored in screen memory, not GCOL numbers.
- p is the probability that an arbitrary cell will have it's contents overwritten by a new
- randomly selected value.
- Thus PROCsoup(0,256,1) fills the window randomly with colours from the whole range,
- while PROCsoup(255,1,.1) will scatter white cells over about ten percent of the background.
-
- PROCload prompts the user for the filename of a previously saved screen, & then loads it into the
- CA window. Note, screens are stored in a directory called 'Screens' which should be present
- in the same directory that contains !ArcAut; ArcAut expects this to exist, when saving &
- loading screens, so you should ensure the directory is present, even if empty.
-
- PROCmouseon initialises the pointer & restricts it to the window containing the CA universe; this procedure
- expects the variables sux% & suy% to hold the width & height of the window; you must set these
- up by reading the values stored in the system variables sux & suy; see for example
- the automaton 'Wire'.
-
- PROCcursors(x%,y%) returns in x% & y% values according to which cursor keys are pressed.
-
- FNround(n%) returns the greatest integer r%, r%<=n%, such that r% is a legal constant for direct use
- in automaton code; (for example, numbers in the range {256-1023} must be a multiple of 4).
-
- FNacol(c%) converts an actual colour value to a GCOL value (with colour in the low bits, 0 to 5,
- & tint in bits 6 & 7). Use for example g%=FNacol(c%):GCOL g%AND63 TINT g%. This is very useful
- if you want to draw something on screen, but only have the cell state number as used by the
- automaton code (this being the actual colour value, as stored in screen memory).
-
- FNlcol(c%) converts a GCOL number (with tint in the top two bits) to an actual colour value.
-
-
- All these routines can be used within the sections of automaton definition dealing with initialisation of parameters, & set up
- of the screen. If you need to access values stored in system variables then you should use something like the following, which
- sets the Basic variable sux% to the value held in the system variable sux:
- DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256:sux%=!buf%
-