MINESWEEPER APPLET - USER INSTRUCTIONS

Exporting a puzzle.
Each puzzle construction screen within the Magnum Opus program has a Tasks / Export as Applet menu option. If you have a puzzle selected into the screen, then selecting this option will result in the following three files being copied into the java sub-folder of your main Magnum Opus folder:-
  • A single .minesweeper file. This is the file which contains the actual puzzle which you have selected for interactive publication.

  • The file minesweeper.jar This is the Java program file which creates the interactive environment in which the puzzle will operate.

  • The file puzzle.html This is the file which starts the interactive process. Double clicking on the icon of this file will start your web browser with your puzzle displayed and ready for interactive operation in a test environment.
Publishing the puzzle.
All that is now required to publish the puzzle on the Internet is to upload the three files onto your web server, and to provide a link from one of your existsing web pages to the puzzle.html file.

If the exported puzzle performs correctly when operated locally on your hard drive, but fails to do so after loading onto your web server, it will probably be caused by one of the following factors:-
  • Some web servers are case sensitive, so that a file called Puzzle.html is NOT the same as a file called puzzle.html It is a very good idea to use ONLY lower case letters when naming files, and needless to say, you should also use lower case letters when you refer to those files in the applet parameters.

  • All puzzle files (.crossword, .acrostic, .sudoku, etc) are binary files, not text files, and transfer of these files to the server MUST be done in the binary mode. Failure to do so will lead to unpredictable results.

  • Some web servers place restrictions on the type of file which they will allow to be downloaded. Naturally, all servers will download .html, .gif, .jpg, .zip, .class, .exe, etc files, but occasionaly a server will be encountered which will not permit .crossword, .acrostic, .sudoku, etc files to be downloaded. This is usually a configuration option which can be changed by the server administrator, so if you run into this problem, your first action should be to discuss the matter with your Internet Service Provider. If they are unwilling to make the necessary change, then you can change the name of the puzzle file (for example from puzzle.sudoku to puzzle.gif), and also change its name where it is referred to in the applet parameters.
Changing the appearance of the puzzle.
You should find the puzzle perfectly acceptable exactly as it is exported by Magnum Opus. You can however make changes to the appearance and behaviour of the applet using a system of param statements located within the puzzle.html file. There is a very comprehensive selection of params the use of which is explained in the following. Simply click on any topic in the following index for a complete description of the params involved with that topic.
INDEX OF MINESWEEPER APPLET PARAMETERS.
 <applet> Tag 
 Component Colors 
 Component Labels 
 Component Locations 
 Control Tips 
 Help Text 
 Miscellaneous Settings 
 Puzzle Selection 
 Warning 


<applet> Tag
<applet code="minesweeper.class" archive="minesweeper.jar" width=500 height=595>
</applet>

These lines begin and end the applet HTML tag which is responsible for loading and running the applet.
The width and height values may be changed if you want a bigger or smaller puzzle in your web page. Depending on the values you select, you may need to rearrange the locations of the components of the Applet, using the various  loc params. 
 Return to Index 


Warning
If an attempt is made to process an HTML file containing a Java Applet on a computer on which Java processing has been disabled, then any HTML code immediately following the <applet ...> tag will be displayed in place of the Applet. The following is a block of code which will explain the situation to the visitor to your web page, along with instructions on how to configure their computer so that the Applet will run correctly.

<hr color="teal"/><font color="red"><h1>WARNING!</h1></font>
<font size="5" color="red">You must use a Java enabled browser to solve this puzzle.</font><p/>
<div align="left"><font face="arial">Enabling your browser is quite a simple matter,
requiring only a few minutes to complete the following steps:-
<ul>
<li/>Begin by downloading and installing the <b>Java Runtime Environment</b>. This is a small program which is available free from the <font color="red">ORACLE</font> web-site at<br/>
<a href="http://www.java.com/en/download/manual.jsp">http://www.java.com/en/download/manual.jsp</a><p/>

<li/>In most cases you will probably also need to change your browser <b>Preferences</b> to actually enable Java processing. The steps involved here will depend on the browser you are using. Details of the actual steps for most popular browsers are provide by the <font color="red">ORACLE</font> web-site at<br/>
<a href="http://www.java.com/en/download/help/enable_browser.xml"> http://www.java.com/en/download/help/enable_browser.xml</a>

</ul><br/><hr color="teal"/></font></div>

 Return to Index 


Component Colors
<param name="bgcolor"   value="CCCCBB">
<param name="bordercolor"   value="002244">
<param name="titlecolor"   value="FFFFFF">
<param name="titlebgcolor"   value="002244">
<param name="buttoncolor"   value="FFFFFF">
<param name="buttontextcolor"  value="000000">
<param name="cellcolor"   value="AAAAAA">
<param name="clearcolor"   value="FFFFFF">
<param name="flagcolor"   value="FF0000">
<param name="numberscolor"   value="FFFF00">
<param name="gridcolor"   value="000000">
<param name="minecolor"   value="000000">
<param name="fusecolor"   value="FF0000">
<param name="hintcolor"   value="0000FF">
<param name="errorcolor"   value="FF0000">

Using these params you can control the colors of the following components of the applet:-

bgcolor :  The background color of the applet.
bordercolor :  The color of the optional border of the applet.
titlecolor :  The color of the optional puzzle title.
titlebgcolor :  The background color of the puzzle title.
buttoncolor :  The background color of the buttons.
buttontextcolor :  The color of the text inside the buttons.
cellcolor :  The color of those cells which have not yet been solved.
clearcolor :  The color of those cells which have been declared clear of mines.
flagcolor :  The color of the flag which contains the number of adjacent mines.
numberscolor :  The color of the numbers on the flags.
gridcolor :  The color of the grid lines within the puzzle.
minecolor :  The color of the mine in those cells declared as mined cells.
fusecolor :  The color of the lit fuse on the image of a mine.
hintcolor :  The color of the border surrounding hint cells.
errorcolor :  The color of cells which are in error when the Show Errors button is clicked.

Notes:
  • Colors are defined by means of 6 digit hexadecimal numbers. Digits 1 and 2 specify the RED content, digits 3 and 4 specify the GREEN content, and digits 5 and 6 specify the BLUE content.
  • If you use FFFFFF (pure white) for buttoncolor the applet will draw standard Java style buttons. If you want a white button, use FEFEFE which is a very light gray, indistinguishable from white.
 Return to Index 

Component Labels
<param name="errors"     value="Reveal Errors">
<param name="restart"     value="Start Again">
<param name="revealsol"     value="Reveal Solution">
<param name="requesthint"    value="Request a Hint">
<param name="help"     value="Help">

These params set the text displayed on each of the applet buttons.
 Return to Index 


Component Locations
<param name="titleloc"     value="000 000 500 035">
<param name="choiceloc"     value="010 040 165 065">
<param name="restartloc"     value="170 070 330 095">
<param name="revealsolloc"    value="335 040 490 065">
<param name="errorsloc"     value="170 040 330 065">
<param name="hintloc"     value="335 040 490 065">
<param name="helploc"     value="335 070 490 095">
<param name="puzzleloc"     value="005 100 495 590">

Using these params you can control the location of the following components of the applet:-

titleloc :  The location of the puzzle title.
choiceloc :  The location of the choice box.
restartloc :  The location of the Start Again button.
revealsolloc :  The location of the Reveal Solution button.
errorsloc :  The location of the Show Errors button.
hintloc :  The location of the Request a Hint button.
helploc :  The location of the Help button.
puzzleloc :  The location of the puzzle.

Notes:
  • Each location specification consists of a set of 4 three digit numbers which represent the left, top, right and bottom coordinates of the component.
  • Normally, these coordinates are expressed in terms of pixel locations within the body of the applet.
  • Alternatively, if you set the usescaling parameter to true, the numbers will represent locations read from a coordinate system in which the applet is divided into 1000 units both horizontally and vertically. This is very handy if you want to be able to change the size of the applet without needing to change the location parameters for each of the components.
  • Most of the components are optional, and can be removed from the applet by omitting the appropriate parameter, or by setting each of the four three digit numbers to 000.
 Return to Index 

Control Tips
<param name="selecttip"     value="Select a different puzzle to solve">
<param name="errorstip"     value="Indicate those portions of the solution which are in error.">
<param name="restarttip"     value="Abandon the current partial solution, and start again.">
<param name="revealsoltip"    value="Reveal the complete solution for this puzzle.">
<param name="hinttip"     value="Request a hint regarding the next step in solving the puzzle.">
<param name="helptip"     value="Display the Help information for this puzzle.">

Using these params, you can include some explanatory text which is displayed by the applet when the mouse cursor is pointed at any of the buttons or other controls within the applet.
 Return to Index 


Help Text
<param name="help"     value="Help">
<param name="helploc"     value="012 550 137 610">
<param name="helpheader"    value="MINESWEEPER Help">
<param name="help1"     value="Here you can insert">
<param name="help2"     value="whatever information">
<param name="help3"     value="you think your solvers">
<param name="help4"     value="should know about.">

These params allow you to set the text of the Help information which is displayed when a solver clicks the Help button.
Notes:

  • It is a simple matter to compose a help set in any language you desire.
  • You can use as many lines of Help as you wish. Numbering MUST start from 1 and continue upward without any omissions.
  • Bear in mind that the length of the longest line will determine the width of the box in which the Help is displayed.
  • Any line which contains only a single space character will print as a blank line. Use this fact to break your Help text into paragraphs.
 Return to Index 

Miscellaneous Settings
<param name="noreveal"    value="The Reveal function has been disabled on this puzzle">

Magnum Opus can create puzzles in which the Reveal function is disabled. This parameter sets the text that will be displayed if the solver tries to use one of the Reveal functions on such a puzzle.


<param name="borderwidth"    value="1">

As mentioned previously, a border can be placed around the entire applet. The width of the border can be set with this parameter. If you don't want a border, simply set the value of borderwidth to 0.


<param name="titlesize"    value="6">

The applet can display a title for the puzzle. The words of this title will be the Puzzle Name which you entered into the Puzzle Description dialog of Magnum Opus before you built the puzzle. Use this parameter to control the size of the text used to display the puzzle name. If the puzzle title will not fit into the space you have allowed for it, a smaller font will be substituted.


<param name="congrats"    value="CONGRATULATIONS">
<param name="correct"    value="Your solution is correct.">

When a puzzle is solved correctly, the solver is presented with a message box. The congrats parameter provides the title of the message box, and the correct parameter provides the text displayed in the body of the message box.


<param name="usescaling"    value="false">

The coordinates used in the Component Location params are normally expressed in pixels. Setting the usescaling parameter to true will result in the coordinates being interpreted as thousandths of the width and height of the applet.
 Return to Index 


Puzzle Selection
The puzzle actually presented to the solver can be controlled by means of parameters in a number of different ways as described in the following three topics:-

Single Puzzle
<param name="puzzle1"    value="easy.minesweeper">

This param would be used in the very simple case where you want the applet to process the same single puzzle each time it is used.


Choice Box
<param name="puzzle1"    value="easy.minesweeper">
<param name="puzzle2"    value="harder.minesweeper">
<param name="puzzle3"    value="hard.minesweeper">

If you want the applet to handle more than one puzzle, you should enter a value for the  choiceloc  parameter. This will create a choice box in the location you specify. For each puzzle which you want the applet to handle, you should include a puzzlen parameter. The numeral added to puzzle must start at one and increase by one (no gaps please) for each new puzzle. You can include as few as one puzzle, or as many as you like. The values associated with the puzzlen parameters are the actual names of the puzzle files.

If you are publishing a single puzzle, then you can omit the choiceloc parameter, and use only the puzzle1 parameter.
 Return to Index 


Daily Puzzles
<param name="startdate"   value="10 03 22">
<param name="period"   value="1">
<param name="recycle"   value="1092">

Many Magnum Opus users will want to arrange for a new puzzle to be published each day. This can be done very easily, without the need for complex script files or any daily manual editing. Simply name your puzzles at the time of creation with a number - (for example 123.minesweeper). The puzzle build function includes an option which allows you to build many puzzles in a single operation, and to automatically name them with an increasing numerical value.

Provided you don't include the puzzle parameters mentioned in the previous item, the applet will look for a puzzle file which has a number as its name. It calculates the value of that number by reference to the startdate, period and recycle parameters. Puzzle number 1 will be selected on the day whose date is given by the startdate parameter (format is yy mm dd). The puzzle number to be used subsequently will increase by 1 with each period of time equal to the number of days specified by the period parameter.

The recycle parameter is optional, and if included will allow puzzles to be reused cyclicly. For example, if you make (and upload) a set of 1092 puzzles, and set the period parameter to 1 and the recycle parameter to 1092, then the puzzles will be reused after the elapse of three years (156 weeks or 1092 days).

If you also include a  choiceloc  parameter, then the choice box will provide access to the seven most recent puzzles.
 Return to Index