html("

About the MENACE construal

MENACE is the acronym of Donald Michie's Matchbox Educable Noughts-And-Crosses Engine. The construction of a MENACE construal is scaffolded using an extended presentation that makes use of the JSPE. (You may need to click the '>>' button in the JSPE panel to start the presentation.)

The idea behind the presentation is to trace the stream-of-thought that has been followed in building up resources that can aid understanding of MENACE, and can in principle be the basis for an emulation of its behaviour. As the presentation proceeds, a wide range of auxiliary issues that relate to making construals in general as well as to MENACE specifically are briefly reviewed and motivated. The aim of presenting the construal in this way is to show how (or determine whether!) schoolteachers with backgrounds in computing and mathematics can collaboratively compile teaching resources that both have independent interest and, when taken together, contribute to a fully developed construal that can help to explain and illustrate the principles behind MENACE. Were we to adopt a conventional approach to programming, writing an emulator for MENACE would perhaps be considered to be a relatively advanced topic. In making construals, we aspire to reduce the conventional programming content to the specification of functions and procedures in a basic procedural style in such a way that all functions and procedures are direct by-products of an application-oriented thought process. A relevant research question is \"to what extent can the difficulty in making a MENACE construal and associated emulator suitable for classroom use and experiment be reduced merely to understanding the principles of MENACE itself?\".

The development of the MENACE construal builds upon a pre-existing simple construal of the game of noughts-and-crosses which is a useful resource for teaching making construals in its own right. There is provision in the presentation for this to be loaded from an online directory. For convenience, to make the presentation more self-contained, a copy of the relevant file, called simpleNandC.js-e, will be explicitly included. "); ## the file: simpleNandC.js-e x = 1; o = -1; u = 0; boardstate = [u,u,u,u,u,u,u,u,u]; s1 is boardstate[1]; s2 is boardstate[2]; s3 is boardstate[3]; s4 is boardstate[4]; s5 is boardstate[5]; s6 is boardstate[6]; s7 is boardstate[7]; s8 is boardstate[8]; s9 is boardstate[9]; allsquares is boardstate; WN is Point(100+size*0.5, 100+size*4.5); NW is Point(100+size*2.5, 100+size*6.5); NE is Point(100+size*4.5, 100+size*6.5); EN is Point(100+size*6.5, 100+size*4.5); ES is Point(100+size*6.5, 100+size*2.5); SE is Point(100+size*4.5, 100+size*0.5); SW is Point(100+size*2.5, 100+size*0.5); WS is Point(100+size*0.5, 100+size*2.5); sq1 is Point(100+size*1.5, 100+size*5.5); sq2 is Point(100+size*3.5, 100+size*5.5); sq3 is Point(100+size*5.5, 100+size*5.5); sq4 is Point(100+size*1.5, 100+size*3.5); sq5 is Point(100+size*3.5, 100+size*3.5); sq6 is Point(100+size*5.5, 100+size*3.5); sq7 is Point(100+size*1.5, 100+size*1.5); sq8 is Point(100+size*3.5, 100+size*1.5); sq9 is Point(100+size*5.5, 100+size*1.5); WNEN is Line(WN.x,WN.y,EN.x,EN.y); WSES is Line(WS.x,WS.y,ES.x,ES.y); NWSW is Line(NW.x,NW.y,SW.x,SW.y); NESE is Line(NE.x,NE.y,SE.x,SE.y); picture is [WNEN, WSES, NWSW, NESE]; size = 40; lab1 is (s7 == o) ? "O" : ((s7 == x) ? "X" : ""); piece1 is Text(lab1,sq1.x-10, sq1.y+10, "black", 32); lab2 is (s8 == o) ? "O" : ((s8 == x) ? "X" : ""); piece2 is Text(lab2,sq2.x-10, sq2.y+10, "black", 32); lab3 is (s9 == o) ? "O" : ((s9 == x) ? "X" : ""); piece3 is Text(lab3,sq3.x-10, sq3.y+10, "black", 32); lab4 is (s4 == o) ? "O" : ((s4 == x) ? "X" : ""); piece4 is Text(lab4,sq4.x-10, sq4.y+10, "black", 32); lab5 is (s5 == o) ? "O" : ((s5 == x) ? "X" : ""); piece5 is Text(lab5,sq5.x-10, sq5.y+10, "black", 32); lab6 is (s6 == o) ? "O" : ((s6 == x) ? "X" : ""); piece6 is Text(lab6,sq6.x-10, sq6.y+10, "black", 32); lab7 is (s1 == o) ? "O" : ((s1 == x) ? "X" : ""); piece7 is Text(lab7,sq7.x-10, sq7.y+10, "black", 32); lab8 is (s2 == o) ? "O" : ((s2 == x) ? "X" : ""); piece8 is Text(lab8,sq8.x-10, sq8.y+10, "black", 32); lab9 is (s3 == o) ? "O" : ((s3 == x) ? "X" : ""); piece9 is Text(lab9,sq9.x-10, sq9.y+10, "black", 32); picture is [WNEN, WSES, NWSW, NESE, piece1, piece2, piece3, piece4, piece5, piece6, piece7, piece8, piece9]; near = 50; mouseXnear1 is ((mouseX-160)*(mouseX-160)\n"; for (i = 1; i <= dataRows[j]#; i++) { html = html // " "; html = html // dataRows[j][i]; html = html // "\n"; } html = html // " \n"; } html = html // "\n"; return Div(name, x, y, width, height, html); } buttonPrev is SlideButton("buttonPrev","<< Slide #" // str(currentSlide), jspeleft, 0, buttonPrevEnabled); buttonNext is SlideButton("buttonNext",">>", jspeleft+150, 0, buttonNextEnabled); ## to protect against loss of information whilst constructing patterns ${{ var workIsDone = false; window.onbeforeunload = confirmBrowseAway; function confirmBrowseAway() { if (!workIsDone) { return "Are you sure? If you leave this page now, your work will NOT be saved."; } }; }}$; iggy4 is Slide("

About MENACE

The Matchbox Educable Noughts And Crosses Engine (MENACE) was devised by Prof Donald Michie ...

MENACE consists of an array of about 300 matchboxes each of which corresponds to a distinct position in a game of noughts-and-crosses. Each matchbox contains a set of beads that are coloured-coded. A bead of a particular colour corresponds to a possible move in the position represented by the matchbox. MENACE 'plays' nought-and-crosses by identifying the matchbox corresponding to the current position, then selecting a bead at random from the matchbox, and making the corresponding move. By monitoring the outcomes of games, the distribution of coloured beads in each matchbox can be adjusted to increase the probability of making a good move.

... some relevant references

"); menace1 is Slide("

The general idea behind MENACE

In concept, MENACE is based on the idea that

By making the choice of move reflect its weighting, you can create a stronger noughts-and-crosses player.

"); iggy5 is Slide("

Modelling noughts-and-crosses

As a first step towards making a computer model that helps us to understand more about MENACE, we'll first introduce a model of Noughts and Crosses. include(\"models/NoughtsCrosses/simpleNandC.js-e\"); ## on later versions of JS-EDEN ## include(\"http://jseden.dcs.warwick.ac.uk/models/NoughtsCrosses/simpleNandC.js-e\");

On the default HTML5 canvas, there are some lines. They represent a grid on which you can play noughts and crosses. In the top left corner, there is a drop down menu in which you can select whether you wish to make a move for O or X (adding a 'nought' or a 'cross' to the grid). To play in a particular square, you simply click with the mouse near the centre of the square. Try playing a game ...

What you are interacting with when playing noughts and crosses in this environment is quite different from a traditional computer program. Perhaps you can think of some reasons why?

"); slideList is [iggy4, menace1, iggy5]; iggy5b is Slide("

... some reasons why the model is unlike a program ...

also ...

Call this peculiar 'interactive artefact' a construal. Making a construal is based on principles altogether very different from writing a user-friendly program.

Cf. What are the principles of writing a user-friendly program?

"); ## cf Steve / WMB on the theme of distinctions between a program and a construal - though may be premature here slideList is [iggy4, menace1, iggy5, iggy5b, iggy6]; iggy6 is Slide("

How does a construal differ from a program?

  1. much more to the construal than meets the eye (literally) - your task is typically to 'explore' the construal rather than 'use it'
  2. to appreciate the construal you need to do more than perform obvious interactions and interpret them in the routine way that a trad user of a program does
  3. you will need to look more closely into how the construal is constructed
Some reflections on this difference ... "); iggy7 is Slide("

A 'construal comprehension' exercise

What do you pay attention to when playing noughts-and-crosses?

  1. what symbols are on the board/grid
  2. Where the symbols are
  3. What the winning lines are
  4. Whether the game is over
  5. Whether either player has won
  6. Whether the board position is valid
  7. Whose turn it is
  8. What colour are the symbols?
Note that there is a dependency - a player with rudimentary familiarity with the rules knows whether someone has won etc as soon as they take in the position of the symbols on the board. (You wouldn't ordinarily think about the distinction between 'glancing at the board' and 'seeing whether the game is finished' etc. But there may be situations in which these observations should be distinguished.)

Exercise: identify the observables in the construal that answer the above questions (if they exist!). If they don't exist, consider how you would introduce them. In each case, explain:

In what situations might observations that are perceived as routinely linked by dependency be distinguished? What other observables might there be?

"); iggy7a is Slide("

Some answers / useful interactions

Note that the checkxwon and checkowon functions are generic - they determine whether a line of arbitrary length comprises only x's or only o's. The oline function was originally introduced with a view to eliminating complex procedural functions, and specifying dependencies simply with scripts.

"); slideList is [iggy4, menace1, iggy5, iggy5b, iggy6, iggy7, iggy7a]; iggy8a is Slide("

Some layout issues

When we initially make a visualisation, we typically do this in a rough-and-ready way. Worth studying the way in which the noughts and crosses board has been constructed, and its limitations.

The exploration of a construal is an empirical activity, for which no prescription can be made. Identifying observables and finding observable names involves some idea of the naming conventions and an element of serendipity. Here's a possible way in which we can find out how the noughts-and-crosses board is constructed without any prior knowledge of the observables involved: