home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / fractal / arcaut / Info / Table5 < prev   
Encoding:
Text File  |  1991-07-31  |  3.1 KB  |  44 lines

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