home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 093.lha / Chaos / Sources / cpages.mod < prev    next >
Encoding:
Modula Implementation  |  1986-11-21  |  3.6 KB  |  106 lines

  1. (*
  2.      This module contains procedures that display some of the
  3.      'about' pages.
  4.  
  5.      Note: If this module doesn't compile, and you get an error
  6.      "too many strings", then  you will have to re-configure
  7.      your compiler to have larger space allocated for strings.
  8.  
  9.      Created: 8/30/87 by Richie Bielak
  10.      
  11.      Modified:
  12.      
  13.      Copyright © 1987 by Richie Bielak
  14.      
  15.      This program maybe freely copied, but please leave my name in.
  16.      Thanks...Richie
  17.  
  18. *)
  19. IMPLEMENTATION MODULE ChaosPages;
  20.  
  21. FROM SYSTEM    IMPORT ADR;
  22. FROM Text      IMPORT Text;
  23. FROM Intuition IMPORT WindowPtr;
  24. FROM Drawing   IMPORT SetAPen, Move;
  25.  
  26. VAR
  27.   cur_x, cur_y : CARDINAL;
  28.  
  29. (* ++++++++++++++++++++++++++++++++++++++++ *)
  30. (*$D- *)
  31. PROCEDURE WriteT (wp : WindowPtr; text : ARRAY OF CHAR);
  32.   BEGIN
  33.     Move (wp^.RPort^, cur_x, cur_y);
  34.     INC (cur_y,10);
  35.     Text (wp^.RPort^, ADR(text), HIGH(text));    
  36.   END WriteT;
  37. (*$D+ *)
  38.  
  39. (* ++++++++++++++++++++++++++++++++++++++++ *)
  40. PROCEDURE DisplayPage1 (wp : WindowPtr);
  41.   BEGIN
  42.     cur_x := 5; cur_y := 20;
  43.     SetAPen (wp^.RPort^, 15);
  44.     WriteT (wp, "  This program can be used to explore");  
  45.     WriteT (wp, 'the "Hennon  mapping".  The  mapping');
  46.     WriteT (wp, "consists of iterative  application of");
  47.     WriteT (wp, "a function to points on a plane.  The");
  48.     WriteT (wp, "function is  applied  to a  starting ");
  49.     WriteT (wp, "point to give another point. Then the");
  50.     WriteT (wp, "function  is  applied  to the  second");
  51.     WriteT (wp, "point, to  give a third ... and so on.");
  52.     WriteT (wp, "All computed  points are plotted. The ");
  53.     WriteT (wp, "resulting drawing is an 'orbit'. When");
  54.     WriteT (wp, "a  different starting value is picked");
  55.     WriteT (wp, "a new orbit results. This program will");
  56.     WriteT (wp, "draw a number of orbits to produce its");
  57.     WriteT (wp, "picture.  Using the control panel you ");
  58.     WriteT (wp, "change the starting condition  to get");
  59.     WriteT (wp, "different pictures.");
  60.   END DisplayPage1;
  61.  
  62. (* ++++++++++++++++++++++++++++++++++++++++ *)
  63. PROCEDURE DisplayPage2 (wp : WindowPtr);
  64.   BEGIN
  65.     cur_x := 5; cur_y := 20;
  66.     SetAPen (wp^.RPort^, 15);
  67.     WriteT (wp, "  The following formula is used to");
  68.     WriteT (wp, "compute the pictures:");
  69.     WriteT (wp, " ");
  70.     WriteT (wp, "  x = x * cos(a) - (y - x*x) * sin(a)");
  71.     WriteT (wp, "  y = x * sin(a) + (y - x*x) * cos(a)");
  72.     INC (cur_y,10); (* Skip a line *)
  73.     WriteT (wp, "The  coefficient 'a'  determines the");
  74.     WriteT (wp, "shape of the final picture. The values");
  75.     WriteT (wp, "of 'a' should stay in the range 0 to");
  76.     WriteT (wp, "about 7.");
  77.     INC (cur_y,10);
  78.     WriteT (wp, "To find out more about Hennon maps see");
  79.     WriteT (wp, "the 'Computer Recreations' column in");
  80.     WriteT (wp, 'July 1987 "Scientific American".');
  81.   END DisplayPage2;
  82.  
  83.  
  84. (* ++++++++++++++++++++++++++++++++++++++++ *)
  85. PROCEDURE DisplayPage3 (wp : WindowPtr);
  86.   BEGIN
  87.     cur_x := 5; cur_y := 20;
  88.     SetAPen (wp^.RPort^, 15);
  89.     INC (cur_y,10);
  90.     WriteT (wp, " This program was written using the");
  91.     WriteT (wp, "       Benchmark Modula-2");
  92.     WriteT (wp, "        by Richie Bielak");
  93.     INC (cur_y, 10);
  94.     WriteT (wp, " Copyright © 1987 by Richie Bielak");
  95.     INC (cur_y, 10);
  96.     WriteT (wp, " This program can be freely copied,");
  97.     WriteT (wp, " but please leave my name in. Thanks!");
  98.     INC (cur_y, 10);
  99.     WriteT (wp, " Thanks to Mike Scalora for EASYMENUS!");
  100.     INC (cur_y, 10);
  101.     WriteT (wp, " Comments/question -> Richie Bielak");
  102.     WriteT (wp, "   CIS 75716,352, PLINK: RICHIEB");
  103.   END DisplayPage3;
  104.  
  105. END ChaosPages.
  106.