home *** CD-ROM | disk | FTP | other *** search
- <HTML>
- <HEAD>
- <TITLE>
- Programming
- </TITLE>
- <xinclude file="head.xrh">
- </HEAD>
-
- <xinclude file=body.xrh>
- <xtop>
- <h1>
- <xnode name="program" sub="drawboard">
- Programming
- </xnode>
- </h1>
- The program CopyCat is relatively small -- under 2000 lines of code; the class
- files are under 40K. This makes it an attractive program for the net.
- Its small size is due to the concise language of mathematics.
- Another reason is that java is also a very concise language.
- <hr>
- <h2>The program</h2>
- (For the following to make sense, it is important to be familiar with
- <em>CopyCat</em>)
-
- <p><em>CopyCat</em> is made up of many components: PlayArea, BoardBox,
- Rotator, and Title.
- PlayArea (<a href="java/PlayArea.java">PlayArea.java</a>)
- is the component where all the action
- occurs. It has a complex interface to handle all the players' manipulations
- of the solid object. PlayArea reports back to CopyCat
- (<a href="java/CopyCat.java">CopyCat.java</a>) whenever the player does
- something significant.
-
- <p>BoardBox (<a href="java/BoardBox.java">BoardBox.java</a>)
- is the part that shows the static original picture that the player must
- copy (I call it a board)--not much to it.
-
- <p>Rotator (<a href="java/Rotator.java">Rotator.java</a>)
- has the solid object rotating and bouncing in a non-repeating way. There
- is also a user interface where the player can grab the object and rotate
- it manually, but as soon as the player lets go, it returns to tumbling.
-
- <p>Title (<a href="java/Title.java">Title.java</a>)
- is a trival component that simply puts centred text in a box. It is used
- for the title and the score.
-
- <p>PlayArea and BoardBox rely on the object Board
- (<a href="java/Board.java">Board.java</a>).
- Board holds all the information of the board and has a few methods that
- relate to the board -- drawing the board, clearing the board, and counting
- the correct matches on the board.
-
- <p>PlayArea,Rotator and Board rely on the object Solid
- (<a href="java/Solid.java">Solid.java</a>).
- Solid holds all the 3D information relating to the solid object and has
- a few methods as well.
-
- <p>PlayArea and Board rely on the object GroupGraph
- (<a href="java/GroupGraph.java">GroupGraph.java</a>).
- GroupGraph holds all the preferred orientation of the solid, how to get from
- one oriention to another, and the symmetries of the faces the of solid.
-
- <p>PlayArea, Rotator and Solid use the object Omatrix
- (<a href="java/Omatrix.java">Omatrix.java</a>), the orthogonal/orientation
- matrices.
- Omatrix holds a matrix and has many matrix methods.
-
- <hr>
- <h2>The config files</h2>
- <p>One of the most flexible parts to CopyCat is that it has very little
- hardwiring; all of the changeable information is read in with files:
- which object that is used, which group graph that is used, the screen
- setup, and the board. This saves oodles of time compiling, and will eventually
- lead to user interface where the user will run some application that
- produces these config files. A half measure that is implemented right now
- is that the board status can be retrieved from the System.out--this is a hidden
- feature so that non-techies won't get too excited.
-
- <h3>the files</h3>
- <ul><li>the solid files
- <ul><li><a href="java/cube.dat">cube.dat</a> describes the cube
- <li><a href="java/octa.dat">octa.dat</a> describes the octahedron</ul>
- <ul><li><a href="java/cubeG.dat">cubeG.dat</a> describes the cube preferred orientations
- <li><a href="java/octaG.dat">octaG.dat</a> describes the octahedron
- preferred orientations</ul>
- <ul><li><a href="java/cube1.config">cube1.config</a> describes a board that uses the cube as its object
- <li><a href="java/octa1.config">octa1.config</a> describes a board that uses the octahedon as its object
- <li>this list is long...</ul>
- </ul>
- <xbot>
- </BODY>
- </HTML>
-