To construct the bubblesort demonstration, first introduce
the scout window in sort.s.

Then include sort.d, to introduce the array display.

Finally include sort.e, to introduce the array of values.

At this point, the array of values is stored in the list val.
Reassignments to values can be performed via redefns such as
	val[1] = 23;
	val = [1,2,3,4,5,6,7];
	val = val_set1;
This is a basic environment for checking whether an array of
elements is sorted.

The operation exc.e can be introduced at this point, in order
to allow elements to be exchanged:
	exc(2,5);
exchanges 2nd and 5th element for example.

To monitor the relations between adjacent elements in the array,
can introduce the file ordrel.e at this point.  This includes
a variable ordvis that can be set to 0 or 1 according to whether
visualisation is desired.

To make the least and greatest elements (leftmost in the array)
visible, introduce the file maxmin.e.  This file displays the least
element in RED, and the greatest element in GREEN.  GREEN and RED
are abstract colours, that can be set to any colour - in particular,
GREEN has been assigned to "blue" to enhance visibility.  (Should be
using maximal and minimal for elements strictly!)

At this stage, it is possible to consider making selection sort
possible, using exchanges of least and greatest elements with
first and last elements in the array. (Should probably introduce
the range indicator hidden in bsagents.e at this point!)  To observe
the indices of the greatest and least elements at this point,
introduce selmaxmin.e.  The first steps of such a selectionh sort
are performed by the exchanges: exc(1,ix_min) and exc(7,ix_max).

To support selection sort and bubblesort, need to change the
range of values from val being considered.  To change the range to
be those elements between first and last, and alter the max and
min elements and indices accordingly, introduce more complex
forms of maxmin.e and selmaxmin.e: maxminfl.e and selmaxminfl.e.
(Believe that have now got the range indicator separated from
bsagents.e, so that can display a range and two markers.  These
can then be given the right definitions for bubblesort: cf rangeline.e)

At this point, the user can simulate selection sort by repeatedly
performing:
	exc(first, ix_min);
	exc(ix_max, last);
	first++; last--;
until first and last coincide.

To get an automatic bubblesort, introduce the file bsagents.e.
In this file, there are two observables to represent the index
of the current pass (bs_pass), and one to represent the index of
the current position for comparison of elements (bs_pos).  There
is also a line to indicate the range of elements yet to be sorted,
which initially is [first,last], where first=1 and last=7, and
ultimately first=last=1. To correctly align the values first and
last with the parameters of the bubblesort, use:
	first is 1; last is 7-bs_pass+1;

To initialise the bubblesort, use the definitions:
	nexta = 0;
	bs_pass=1;
	bs_pos =1;
	val = val_set0;
The observable nexta triggers the bubblesort agents, and is
set by user click and reset by the responding agent.
