The eutodraw system, part 1.

William Overington

Copyright 2000 William Overington

All graphical output directly programmable from 1456 object code uses the eutodraw system. The eutodraw system contains three integer arrays, the eutoxlist, the eutoylist and the eutoclist. The eutodraw system considers numbers in triples down the columns for a common index value. The eutoxlist contains x coordinates, the eutoylist contains y coordinates and the eutoclist contains control numbers. The x coordinate is measured in pixels from the top left corner of the applet screen towards the right across the page. The y coordinate is measured in pixels from the top left corner of the applet screen down the page. The top left corner pixel has coordinates of x=0 and y=0. The eutoclist consists of control numbers. Each control number, c, is either non-negative, consisting of an action code multiplied by 100 and a colour code added together, or else is negative and is -1 or -2 or -3.

The command $Z will set the eutodraw system ready to accept commands. The $Z command may be used more than once in a program if so desired. Indeed, some programs use the $Z command hundreds of times within a loop.

The $P command will set the eutodraw system to the next column. A $P command is needed to move to the first column before input is started. It is helpful to think of $P as moving to the next column to the right, so that the eutodraw table fills up from left to right.

A $X command copies the value in the ai1456 register into the eutoxlist place for the current column.

A $Y command copies the value in the ai1456 register into the eutoylist place for the current column.

A $C command copies the value in the ai1456 register into the eutoclist place for the current column.

One may have one or more sets of $P $X $Y $C commands and then one has a $E command to cause the commands in the eutodraw table to be obeyed. Commands are only obeyed up to and including the rightmost column of the eutodraw table that has been brought into use by using a $P command since the eutodraw table was last reset.

A -1 control number is movepen, placing the pen ready at that point, but without making an mark on the screen.

A -2 control number is do nothing.

A -3 control number is used to terminate the definition of a polygon.

A non-negative number below 100 is a drawline command in that particular colour. That is, an action code of 0.

For example, a eutodraw sequence to move the pen to the point (10,20) and then draw a blue line to the point (30,40). The colour blue is colour number 6. The operations are spaced out for clarity.

$Z $P 10 &w $X 20 &w $Y !-1 &w $C $P 30 &w $X 40 &w $Y 6 &w $C $E

The $Z sets the eutodraw system ready to accept commands.

The $P moves to the first column.

The 10 &w $X loads 10 as the x value for the present triple.

The 20 &w $Y loads 20 as the y value for the present triple.

The !-1 &w $C loads -1 as the control number for the present triple.

The $P moves to the next column.

The 30 &w $X loads 30 as the x value for the present triple.

The 40 &w $Y loads 40 as the y value for the present triple.

The 6 &w $C loads 6 as the control number for the present triple.

The $E causes the commands in the eutodraw table to be obeyed.

x

10

30

y

20

40

c

-1

6

 

The colour codes are devised for the eutodraw system and use the standard Java colours and a few others. The numbers have been chosen to be identical with the resistor colour code used in electronics for numbers from 0 to 9.

0.black
1.brown
2.red
3.orange
4.yellow
5.green
6.blue
7.magenta
8.gray
9.white
10.cyan
11.pink
12.dark gray
13.light gray
14.art gallery
15.dark green
16.pale red

An action code of 1 is a draw a rectangle command, equal width and height producing a square.

For example.

$Z $P 200 &w $X 100 &w $Y 106 &w $C 50 &w $X 40 &w $Y !-2 &w $C $E

The $Z sets the eutodraw system ready to accept commands.

The $P moves to the first column.

The 200 &w $X loads 200 as the x value for the present triple.

The 100 &w $Y loads 100 as the y value for the present triple.

The 106 &w $C loads 106 as the control number for the present triple.

The $P moves to the next column.

The 50 &w $X loads 50 as the x value for the present triple.

The 40 &w $Y loads 40 as the y value for the present triple.

The !-2 &w $C loads -2 as the control number for the present triple.

The $E causes the commands in the eutodraw table to be obeyed.

Laid out in a table we have.

x

200

50

y

100

40

c

106

-2

 

The eutodraw system first tries to obey column 1 of the eutodraw table. An action code of 1 in colour 6. That is a blue rectangle with its top left corner at coordinates (200,100). The eutodraw system looks to the next column to the right to find the width and the height of the rectangle and then draws the rectangle, thereby completing the obeying of the first column. The eutodraw system then seeks to obey the second column. It finds a –2 control code so does nothing.

The eutodraw system has many features. In many of the following examples the example is demonstrated with the layout of the eutodraw table. The 1456 object code is not explicitly stated. The 1456 code can produced from the contents of the table by following the previous examples and applying the following general method.

Commence with a $Z command.

For each table column that contains numbers, use $P followed by the x value followed by &w$X, the y value followed by &w$Y, the c value followed by &w$C remembering to use !- before the number if c has a negative value.

Finish with a $E command.

A few explicit examples of the 1456 object code are provided, particularly when these require more than two columns of the eutodraw table to carry out the particular command.

An action code of 2 is draw a filled rectangle command, equal width and height producing a square.

This is similar to the unfilled rectangle except that the action code is 2, so in order to get a filled blue rectangle the 106 of the previous example is changed to 206.

x

200

50

y

100

40

c

206

-2

 

An action code of 3 is a draw an oval command, equal width and height producing a circle. Java uses the term oval rather than ellipse, so I have used it here. I tend to use the word ellipse, as the word oval can be ambiguous, sometimes taken to mean an ellipse and sometimes taken to mean an egg shaped closed curve, larger at one end than the other.

Changing the 106 in the example above to 306 gives an oval.

x

200

50

y

100

40

c

306

-2

 

An action code of 4 is draw a filled oval command, equal width and height producing a circle.

Changing the 106 in the example above to 406 gives a filled oval.

x

200

50

y

100

40

c

406

-2

1456 object code

Copyright 2000 William Overington