home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / language / grs / g / Speedtest < prev    next >
Encoding:
Text File  |  1991-04-07  |  899 b   |  54 lines

  1. (* g.speedtest  -quick demo of counting etc *)
  2. null function go()
  3. {
  4.    string s;
  5.    write("Hit 'g' and then return to go\n");
  6.    read(s);
  7. };
  8.  
  9.  
  10. write("Speedtest - a quick demonstration of \nthe speed of the GRS interpreter.\n\n");
  11.  
  12. let integer i := 0;
  13.           
  14. write("Count up to 500 and back down ...\n");
  15. go();          
  16.  
  17. let integer indent := 0;
  18. let integer increment := 1;
  19. integer in_count;
  20.  
  21. loop
  22.    exiton(i=500);
  23.    write(i,"\n");
  24.    i := i+1;
  25. endloop;
  26. loop
  27.    exiton(i=0);
  28.    write(i,"\n");
  29.    i := i-1;
  30. endloop;  
  31.  
  32. write("Now swirly patterns ...\n");
  33. go();
  34.  
  35. loop
  36.    exiton(i=150);
  37.    in_count := 0;
  38.    loop
  39.       exiton(in_count = indent);
  40.       write(" ");
  41.       in_count := in_count + 1;
  42.    endloop;
  43.    write(i,"\n");
  44.    i := i+1;
  45.    if (indent =75) then 
  46.       increment := -1;
  47.    endif;
  48.    if (indent =0) then 
  49.       increment := 1;
  50.    endif;
  51.    indent := indent + increment;
  52. endloop;
  53.  
  54.