These procedures on character manipulation were provided by Mr Farmer, Birkbeck College.
integer procedure readch;
reads the next character on selected input and produces internal code value as integer.
procedure printch(i); value i; integer i;
outputs the character having internal code position i.
integer procedure peep;
looks at the next character on selected input and produces internal code value as integer, but does not alter input pointer.
procedure skip;
moves over next character on selected input.
This set of procedures enables the user to treat the lineprinter as a simple graph plotting device. The plotting area or field can be of any proportions. If the width of the field is greater than 120 Characters it is automatically broken into sections printed below one another. These procedures were provided by Mr Farmer.
procedure startgraph(leftx,topy,rightx,bottomy,chars,lines); value leftx,topy,rightx,bottomy,chars,lines; real leftx,topy,rightx,bottomy; integer chars,lines;
A call to this procedure must precede all other plotting calls. This procedure sets up the list structure necessary for storing all the plotting information and defines the scales that the programmer wishes to use by specifying the co-ordinates at the top left hand corner and the bottom right hand corner of the field:
The line/space ratio of the lineprinter is 6/10 and should be taken into account when choosing coordinate scales.
procedure plot(x,y,char); value x,y; real x,y; string char;
This plots the first character in the Algol string char at the position corresponding to (x,y). Compound characters are allowed and a dot is printed if the string is empty. If the point (x,y) lies outside the specified field, nothing is plotted.
procedure caption(x,y,string,horiz); value x,y,horiz; real x,y; string string; Boolean horiz;
The given Algol string is plotted starting from point (x,y). If horiz is true it is plotted horizontally, otherwise vertically. Any part of the string lying outside the field will not appear.
procedure border(char); string char;
The first character of the Algol string char is used to border the field. This is useful if a field ends in the middle of a sheet.
procedure finishgraph;
This procedure must be called to produce any graphical output. All the information stored from the last call to startgraph will be output. The list structure is destroyed during output so the procedure should not be called until after a corresponding call to startgraph.
Any amount of information can be plotted at the same point and everything will be overprinted. It is not necessary for leftx < rightx and topy > bottomy although this is the standard orientation for graphs.
real procedure random;
This procedure generates a pseudo-random number in the range (0,1). A different sequence can be generated by changing the octal numbers at (1) and (1) + 1 within the procedure itself.
procedure chisquare(r,n); value r,n; integer r,n;
This procedure performs the chi-square test for randomness of a global procedure called random producing a random sequence in [0,1). It tests n observations dividing the range [0,1) into r intervals.
integer procedure timer;
A call to this procedure sets timer equal to the total number of instruction interrupts used since the start of compilation.