include("models/jspe/run.e"); intro is Slide("

Making a simple construal from scratch

We want you to build a construal of a vending machine.

Imagine that you are standing in front of a vending machine.

Since this is a short exercise, we make some assumptions to simplify your task. In general, you might want to make different initial assumptions.

Suppose that

"); roughsketch is Slide("

Making a 2D pencil-and-paper sketch

Suppose that the components of the vending machine are

You could draw these as cubes, but we only have 2D! - so we'll use rectangles.

Suppose that you have been given (or have been able to find or create) images of the six different fruits.

Using only rectangular shapes and these six images, draw a rough sketch on a piece of paper of what you see in your imagination.

"); orientation is Slide("

Sketch using the computer

Your first task is to use the computer to imitate the experience of standing in front of the vending machine.

You will do this by trying to draw a simple sketch of the vending machine in the canvas 2D window.

Your computer sketch can be similar to your pencil and paper sketch.

"); primitives is Slide("

Drawing a rectangle

To create a rectangle you make a definition:

testrectangle is Rectangle(10,10,100,50);

To save typing (and errors!) you can press the 'Submit' of 'Copy to Input' buttons below to make definitions automatically.

testrectangle is Rectangle(10,10,100,50);

To put this rectangle on the screen: picture is [testrectangle];

We call testrectangle an observable. It probably isn't a rectangle that you can use in your sketch! You will want to change the size and position of testrectangle.

There are exercises to enable you to do this on the next slide ...

"); makingconnections is Slide("

Making connections

Making construals is all about 'making connections' through direct interaction.

To do this, you have to arrange things on the computer screen so that the connections can be experienced.

The observable testrectangle is defined as 'Rectangle(10,10,100,50)'.

We'd like to make the connection between the values 10, 10, 100, 50 and the observable testrectangle.

To experience this connection, you first arrange the screen so that you can see a Script Input Window, the Canvas 2D window, and can read this presentation.

If you go back to the previous slide, you can try putting different values into the Rectangle() function. To do this, you use 'Copy to input' and edit the values.

Changing the values by editing is tedious and indirect. A better way of making the connection between the values 10, 10, 100, 50 and the observable testrectangle is to substitute observables for the values

Let's call them albert, brian, cynthia and diana. We can define them by albert = 10; brian = 10; cynthia = 100; diana = 50; and introduce them into testrectangle:

testrectangle is Rectangle(albert, brian, cynthia, diana);

"); exptrectangle is Slide("

Enriching connections - indefinitely!

Making connections is a very subjective thing. Connections are personal and not binary.

[We can all make some connection between the fragments from the Antikythera and an actual mechanism in a historical context. But consider how much richer an expert's understanding of that connection is that than other people's.]

We enrich our understanding by experimenting with the rectangle and making new connections:

Set up a new window by submitting showObservables(\"Rectangle|testrectangle\");

to open a new 'Symbol List' window on your display.

Select 'All sources' from the drop-down menu in the 'Symbol List'.

"); moreconnections is Slide("

More kinds of connections

Another kind of connection is the connection between things we draw on the screen. Recall the first definition of the observable testrectangle: testrectangle is Rectangle(10,10,100,50);

Copy this definition to input and edit it by appending a '0' character to the name of testrectangle. Submit this definition.

You now have two observables - one referring to the first rectangle we drew, the other one referring to the rectangle we've been experimenting with.

You can put them both on the canvas: picture is [testrectangle, testrectangle0];

With the windows still arranged so that you can see the canvas, input window, Symbol List, slides, try these 'redefinitions' of testrectangle: testrectangle is Rectangle(albert, brian, cynthia, diana, \"red\"); testrectangle is Rectangle(albert, brian, cynthia, diana, \"white\", \"red\");

What other connections are you able to make in this way?

"); firststep is Slide("

Making your construal - step 1

When you've made the connections between observables of type 'Rectangle' described above, you've understood the basic nature of learning to make construals.

You've also learnt some basic skills that you can now use in making your construal of the vending machine.

You are now ready to put these into action! All you have to do now (!) is to draw the rectangles to represent the components of the vending machine:

"); slideListA is [intro, roughsketch, orientation, primitives, makingconnections, exptrectangle, moreconnections, firststep]; bluepeter is Slide("

What your vending machine might look like

Laying out the rectangles for your sketch can be rather boring (!), but this is what is interesting about making construals: you do lots of quite boring things, and yet can get a most interesting and engaging overall effect.

Consider how the best players of billiards are those who play long sequences of what seem to be exceptionally easy shots. To be good at making construals is to maintain vivid connections continuously in the stream of thought.

size = 80; machine is Rectangle(0, 0, 2*size, 4*size); deliveryTray is Rectangle(0, 3*size, 2*size,1* size, \"#808080\"); panel is Rectangle(2*size, 0, 1*size, 4*size, \"red\"); delivery is Rectangle(0, 3*size, 2*size,1*size, \"#808080\"); coinSlot is Rectangle(2.1*size, 0.9*size, 0.05*size, 0.25*size, \"black\"); changeBox is Rectangle(2.1*size, 1.2*size, 0.8*size, 0.2*size, \"white\"); picture is [delivery, machine, panel, coinSlot, changeBox, changeDisplay];

"); slideList is slideListA // [bluepeter]; completevendingmachine is Slide("

To load the 'complete' purse and vending machine construal include(\"models/construit-c2-teacher-cpd/purseandvendingmachine.js-e\");

To operate the machine:

  1. select a fruit juice by clicking on the apple or the grape
  2. select coins from your purse
  3. click over the coinslot

To reset the vending machine for the next purchase: change = -1; selection = 0; totalcost = 0;

There are some issues:

The resources to continue this exploration can be found online. Feel free to send your questions and answers to info@construit.org

"); slideList is slideListA // [bluepeter] // [completevendingmachine]; /*

Displaying the change ...

  • changeDisp is (change<=0)? "" : decodeHTML("£") // str(numpounds) // "." // str(numpence); changeDisplay is Text(changeDisp, 2.2*size, 1.2*size); numpounds is int(change / 100); numpence is change%100;
  • the items for sale apple is HTMLImage("apple", 0.1*size, 0.1*size, 0.8*size, 0.8*size, "models/SciFest2015/shopping/img/apple.png"); grapes is HTMLImage("grapes", 1.1*size, 0.1*size, 0.8*size, 0.8*size, "models/SciFest2015/shopping/img/grapes.png"); picture is [apple, grapes, delivery, machine, panel, coinSlot, changeBox, changeDisplay]
  • Putting a coin in the slot inCoinSlot is (mouseX>=2.1*size) && (mouseX<=2.15*size) && (mouseY>=0.9*size) && (mouseY<=1.15*size);
  • */