home *** CD-ROM | disk | FTP | other *** search
/ cs.rhul.ac.uk / www.cs.rhul.ac.uk.zip / www.cs.rhul.ac.uk / pub / rdp / rdp_cs3460.tar / testtree.m < prev   
Text File  |  1998-05-07  |  800b  |  38 lines

  1. (*******************************************************************************
  2. *
  3. * RDP release 1.50 by Adrian Johnstone (A.Johnstone@rhbnc.ac.uk) 20 December 1997
  4. *
  5. * testtree.m - a piece of Minitree source to test the Minitree compiler
  6. *
  7. * This file may be freely distributed. Please mail improvements to the author.
  8. *
  9. *******************************************************************************)
  10.  
  11. int a=3+4, b=1;
  12.  
  13. print("a is ", a, "\n");
  14.  
  15. b=a*2;
  16.  
  17. print("b is ", b, ", -b is ", -b, "\n");
  18.  
  19. print(a, " cubed is ", a**3, "\n");
  20.  
  21. int z = a;
  22.  
  23. if z==a then print ("z equals a\n") else print("z does not equal a\n");
  24.  
  25. z=a - 3;
  26.  
  27. if z==a then print ("z equals a\n") else print("z does not equal a\n");
  28.  
  29. a = 3;
  30.  
  31. while a > 0 do
  32. begin
  33.   print("a is ", a, "\n");
  34.   a = a - 1
  35. end;
  36.  
  37. (* End of testtree.m *)
  38.