|
@ -280,34 +280,34 @@ margin-top: 1em; |
|
|
</head> |
|
|
</head> |
|
|
|
|
|
|
|
|
<?php |
|
|
<?php |
|
|
if ($print) { |
|
|
if ($print) { |
|
|
echo '<body onload="window.print()">'; |
|
|
echo '<body onload="window.print()">'; |
|
|
} else { |
|
|
} else { |
|
|
echo '<body>'; |
|
|
echo '<body>'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if ($game->toptext != '') { |
|
|
if ($game->toptext != '') { |
|
|
echo $game->toptext.'<br>'; |
|
|
echo $game->toptext.'<br>'; |
|
|
} |
|
|
} |
|
|
?> |
|
|
?> |
|
|
<h1></h1> |
|
|
<h1></h1> |
|
|
|
|
|
|
|
|
<div id="waitmessage" class="answerboxstyle"> |
|
|
<div id="waitmessage" class="answerboxstyle"> |
|
|
This interactive crossword puzzle requires JavaScript and a reasonably recent web browser, such as Internet Explorer 5.5 |
|
|
This interactive crossword puzzle requires JavaScript and a reasonably recent web browser, such as Internet Explorer 5.5 |
|
|
or later, Netscape 7, Mozilla, Firefox, or Safari. If you have disabled web page scripting, please re-enable it and refresh |
|
|
or later, Netscape 7, Mozilla, Firefox, or Safari. If you have disabled web page scripting, please re-enable it and refresh |
|
|
the page. |
|
|
the page. |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<p><table cellpadding="0" cellspacing="0" border="0"> |
|
|
<p><table cellpadding="0" cellspacing="0" border="0"> |
|
|
|
|
|
|
|
|
<?php |
|
|
<?php |
|
|
if ($game->param3 == 2) { |
|
|
if ($game->param3 == 2) { |
|
|
echo "<tr>\r\n"; |
|
|
echo "<tr>\r\n"; |
|
|
game_cross_show_welcome( $game); |
|
|
game_cross_show_welcome( $game); |
|
|
echo "</tr>\r\n"; |
|
|
echo "</tr>\r\n"; |
|
|
echo "<tr><tr><td> </td></tr>\r\n"; |
|
|
echo "<tr><tr><td> </td></tr>\r\n"; |
|
|
} |
|
|
} |
|
|
?> |
|
|
?> |
|
|
|
|
|
|
|
|
<tr> |
|
|
<tr> |
|
@ -333,138 +333,125 @@ var CrosswordFinished, Initialized; |
|
|
// Check the user's browser and then initialize the puzzle. |
|
|
// Check the user's browser and then initialize the puzzle. |
|
|
if (document.getElementById("waitmessage") != null) |
|
|
if (document.getElementById("waitmessage") != null) |
|
|
{ |
|
|
{ |
|
|
document.getElementById("waitmessage").innerHTML = "<?php echo get_string( 'cross_pleasewait', 'game'); ?>"; |
|
|
document.getElementById("waitmessage").innerHTML = "<?php echo get_string( 'cross_pleasewait', 'game'); ?>"; |
|
|
|
|
|
|
|
|
// Current game variables |
|
|
// Current game variables |
|
|
CurrentWord = -1; |
|
|
CurrentWord = -1; |
|
|
PrevWordHorizontal = false; |
|
|
PrevWordHorizontal = false; |
|
|
|
|
|
|
|
|
<?php |
|
|
<?php |
|
|
echo $html; |
|
|
echo $html; |
|
|
?> |
|
|
?> |
|
|
|
|
|
OnlyCheckOnce = false; |
|
|
|
|
|
|
|
|
OnlyCheckOnce = false; |
|
|
// Create the cell-to-word arrays. |
|
|
|
|
|
TableAcrossWord = new Array(CrosswordWidth); |
|
|
// Create the cell-to-word arrays. |
|
|
for (var x = 0; x < CrosswordWidth; x++) |
|
|
TableAcrossWord = new Array(CrosswordWidth); |
|
|
|
|
|
for (var x = 0; x < CrosswordWidth; x++) |
|
|
|
|
|
TableAcrossWord[x] = new Array(CrosswordHeight); |
|
|
TableAcrossWord[x] = new Array(CrosswordHeight); |
|
|
TableDownWord = new Array(CrosswordWidth); |
|
|
TableDownWord = new Array(CrosswordWidth); |
|
|
for (var x = 0; x < CrosswordWidth; x++){ |
|
|
for (var x = 0; x < CrosswordWidth; x++){ |
|
|
TableDownWord[x] = new Array(CrosswordHeight); |
|
|
TableDownWord[x] = new Array(CrosswordHeight); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
GuessLeter = new Array(CrosswordWidth); |
|
|
GuessLeter = new Array(CrosswordWidth); |
|
|
for (var x = 0; x < CrosswordWidth; x++) |
|
|
for (var x = 0; x < CrosswordWidth; x++) { |
|
|
{ |
|
|
GuessLeter[x] = new Array(CrosswordHeight); |
|
|
GuessLeter[x] = new Array(CrosswordHeight); |
|
|
for (var y = 0; y < CrosswordHeight; y++) { |
|
|
for (var y = 0; y < CrosswordHeight; y++) |
|
|
GuessLeter[ x][ y] = "_"; |
|
|
{ |
|
|
} |
|
|
GuessLeter[ x][ y] = "_"; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
solu = new Array(CrosswordWidth); |
|
|
solu = new Array(CrosswordWidth); |
|
|
for (var x = 0; x < CrosswordWidth; x++) |
|
|
for (var x = 0; x < CrosswordWidth; x++) { |
|
|
{ |
|
|
solu[x] = new Array(CrosswordHeight); |
|
|
solu[x] = new Array(CrosswordHeight); |
|
|
for (var y = 0; y < CrosswordHeight; y++) { |
|
|
for (var y = 0; y < CrosswordHeight; y++) |
|
|
solu[ x][ y] = ""; |
|
|
{ |
|
|
} |
|
|
solu[ x][ y] = ""; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (var y = 0; y < CrosswordHeight; y++) |
|
|
for (var y = 0; y < CrosswordHeight; y++) { |
|
|
for (var x = 0; x < CrosswordWidth; x++) |
|
|
for (var x = 0; x < CrosswordWidth; x++) { |
|
|
{ |
|
|
TableAcrossWord[x][y] = -1; |
|
|
TableAcrossWord[x][y] = -1; |
|
|
TableDownWord[x][y] = -1; |
|
|
TableDownWord[x][y] = -1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// First, add the horizontal words to the puzzle. |
|
|
|
|
|
for (var i = 0; i <= LastHorizontalWord; i++) |
|
|
|
|
|
{ |
|
|
|
|
|
x = WordX[i]; |
|
|
|
|
|
y = WordY[i]; |
|
|
|
|
|
s = Guess[ i]; |
|
|
|
|
|
so = Solutions[ i]; |
|
|
|
|
|
for (var j = 0; j < WordLength[i]; j++) |
|
|
|
|
|
{ |
|
|
|
|
|
TableAcrossWord[x + j][y] = i; |
|
|
|
|
|
if( j < s.length) |
|
|
|
|
|
c = s.substr( j, 1); |
|
|
|
|
|
else |
|
|
|
|
|
c = ''; |
|
|
|
|
|
GuessLeter[ x+ j][ y] = c; |
|
|
|
|
|
if( j < so.length) |
|
|
|
|
|
c = so.substr( j, 1); |
|
|
|
|
|
else |
|
|
|
|
|
c = ''; |
|
|
|
|
|
solu[ x+j][ y] = c; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
// First, add the horizontal words to the puzzle. |
|
|
|
|
|
for (var i = 0; i <= LastHorizontalWord; i++) { |
|
|
|
|
|
x = WordX[i]; |
|
|
|
|
|
y = WordY[i]; |
|
|
|
|
|
s = Guess[ i]; |
|
|
|
|
|
so = Solutions[ i]; |
|
|
|
|
|
for (var j = 0; j < WordLength[i]; j++) { |
|
|
|
|
|
TableAcrossWord[x + j][y] = i; |
|
|
|
|
|
if( j < s.length) |
|
|
|
|
|
c = s.substr( j, 1); |
|
|
|
|
|
else |
|
|
|
|
|
c = ''; |
|
|
|
|
|
GuessLeter[ x+ j][ y] = c; |
|
|
|
|
|
if( j < so.length) |
|
|
|
|
|
c = so.substr( j, 1); |
|
|
|
|
|
else |
|
|
|
|
|
c = ''; |
|
|
|
|
|
solu[ x+j][ y] = c; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Second, add the vertical words to the puzzle. |
|
|
// Second, add the vertical words to the puzzle. |
|
|
for (var i = LastHorizontalWord + 1; i < Words; i++) |
|
|
for (var i = LastHorizontalWord + 1; i < Words; i++) { |
|
|
{ |
|
|
x = WordX[i]; |
|
|
x = WordX[i]; |
|
|
y = WordY[i]; |
|
|
y = WordY[i]; |
|
|
s = Guess[ i]; |
|
|
s = Guess[ i]; |
|
|
so = Solutions[ i]; |
|
|
so = Solutions[ i]; |
|
|
for (var j = 0; j < WordLength[i]; j++) { |
|
|
for (var j = 0; j < WordLength[i]; j++) |
|
|
TableDownWord[x][y + j] = i; |
|
|
{ |
|
|
if( j < s.length) |
|
|
TableDownWord[x][y + j] = i; |
|
|
c = s.substr( j, 1); |
|
|
if( j < s.length) |
|
|
else |
|
|
c = s.substr( j, 1); |
|
|
c = ''; |
|
|
else |
|
|
GuessLeter[ x][ y+j] = c; |
|
|
c = ''; |
|
|
if( j < so.length) |
|
|
GuessLeter[ x][ y+j] = c; |
|
|
c = so.substr( j, 1); |
|
|
if( j < so.length) |
|
|
else |
|
|
c = so.substr( j, 1); |
|
|
c = ''; |
|
|
else |
|
|
solu[ x][ y+j] = c; |
|
|
c = ''; |
|
|
} |
|
|
solu[ x][ y+j] = c; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
document.writeln("<tr><td></td>"); |
|
|
document.writeln("<tr><td></td>"); |
|
|
for (var x = 0; x < CrosswordWidth; x++) |
|
|
for (var x = 0; x < CrosswordWidth; x++) { |
|
|
{ |
|
|
document.write("<td align=center>" + (x+1) + " </td>"); //col numbers |
|
|
document.write("<td align=center>" + (x+1) + " </td>"); //col numbers |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Now, insert the row HTML into the table. |
|
|
// Now, insert the row HTML into the table. |
|
|
for (var y = 0; y < CrosswordHeight; y++) |
|
|
for (var y = 0; y < CrosswordHeight; y++) { |
|
|
{ |
|
|
document.writeln("<tr>"); |
|
|
document.writeln("<tr>"); |
|
|
document.write("<td>" + (y+1)+" </td>"); //line numbers |
|
|
document.write("<td>" + (y+1)+" </td>"); //line numbers |
|
|
for (var x = 0; x < CrosswordWidth; x++) { |
|
|
for (var x = 0; x < CrosswordWidth; x++) |
|
|
if (TableAcrossWord[x][y] >= 0 || TableDownWord[x][y] >= 0) { |
|
|
{ |
|
|
|
|
|
if (TableAcrossWord[x][y] >= 0 || TableDownWord[x][y] >= 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var s; |
|
|
var s; |
|
|
s = "<td id=\"c" + PadNumber(x) + PadNumber(y); |
|
|
s = "<td id=\"c" + PadNumber(x) + PadNumber(y); |
|
|
s += "\" class=\"gamebox boxnormal_unsel\" onclick=\"SelectThisWord(event);\">"; |
|
|
s += "\" class=\"gamebox boxnormal_unsel\" onclick=\"SelectThisWord(event);\">"; |
|
|
document.write( s); |
|
|
document.write( s); |
|
|
|
|
|
|
|
|
if( solu[x][y] != '') |
|
|
if( solu[x][y] != '') |
|
|
document.write( solu[x][y]); |
|
|
document.write( solu[x][y]); |
|
|
else if( GuessLeter[x][y]== "_") |
|
|
else if( GuessLeter[x][y]== "_") |
|
|
document.write( " "); |
|
|
document.write( " "); |
|
|
else |
|
|
else |
|
|
document.write( GuessLeter[x][y]); |
|
|
document.write( GuessLeter[x][y]); |
|
|
|
|
|
|
|
|
document.write("</td>"); |
|
|
document.write("</td>"); |
|
|
}else |
|
|
} else { |
|
|
document.write("<td></td>"); //empty cell |
|
|
document.write("<td></td>"); //empty cell |
|
|
} |
|
|
} |
|
|
document.writeln("</tr>"); |
|
|
} |
|
|
} |
|
|
document.writeln("</tr>"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Finally, show the crossword and hide the wait message. |
|
|
// Finally, show the crossword and hide the wait message. |
|
|
Initialized = true; |
|
|
Initialized = true; |
|
|
document.getElementById("waitmessage").style.display = "none"; |
|
|
document.getElementById("waitmessage").style.display = "none"; |
|
|
document.getElementById("crossword").style.display = "block"; |
|
|
document.getElementById("crossword").style.display = "block"; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// ---------- |
|
|
// ---------- |
|
@ -815,10 +802,8 @@ function OnPrint() |
|
|
} |
|
|
} |
|
|
<?php |
|
|
<?php |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
?> |
|
|
?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php |
|
|
<?php |
|
|
if ($showhtmlprintbutton) { |
|
|
if ($showhtmlprintbutton) { |
|
|
?> |
|
|
?> |
|
@ -988,7 +973,6 @@ function CheckHtmlClick() |
|
|
|
|
|
|
|
|
</tr></table> |
|
|
</tr></table> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php |
|
|
<?php |
|
|
if ($onlyshow == false) { |
|
|
if ($onlyshow == false) { |
|
|
echo '<div style="margin-top: 1em;">'; |
|
|
echo '<div style="margin-top: 1em;">'; |
|
@ -1067,7 +1051,6 @@ function CheckHtmlClick() |
|
|
|
|
|
|
|
|
?> |
|
|
?> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body> |
|
|
</body> |
|
|
|
|
|
|
|
|
<?php |
|
|
<?php |
|
@ -1137,7 +1120,6 @@ function game_cross_show_welcome1() { |
|
|
onkeypress="WordEntryKeyPress(event)" onchange="WordEntryKeyPress(event)" autocomplete="off"></div> |
|
|
onkeypress="WordEntryKeyPress(event)" onchange="WordEntryKeyPress(event)" autocomplete="off"></div> |
|
|
<div id="worderror" style="color:#c00000;font-weight:bold;display:none;margin-top:1em;"></div> |
|
|
<div id="worderror" style="color:#c00000;font-weight:bold;display:none;margin-top:1em;"></div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="margin-top:1em;"><tr> |
|
|
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="margin-top:1em;"><tr> |
|
|
<td align="right"> |
|
|
<td align="right"> |
|
|
<button id="okbutton" type="button" class="button" onclick="OKClick();" style="font-weight: bold;">OK</button> |
|
|
<button id="okbutton" type="button" class="button" onclick="OKClick();" style="font-weight: bold;">OK</button> |
|
@ -1146,18 +1128,14 @@ function game_cross_show_welcome1() { |
|
|
|
|
|
|
|
|
</td><td> </td><td> |
|
|
</td><td> </td><td> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="answerbox2" class="answerboxstyle" style="display:none;"> |
|
|
<div id="answerbox2" class="answerboxstyle" style="display:none;"> |
|
|
<h3 id="wordlabel" style="text-transform:uppercase;margin:0;"> </h3> |
|
|
<h3 id="wordlabel" style="text-transform:uppercase;margin:0;"> </h3> |
|
|
<div id="wordinfo" style="font-size:8pt;color:#808080"> </div> |
|
|
<div id="wordinfo" style="font-size:8pt;color:#808080"> </div> |
|
|
<div id="wordclue" class="cluebox"> </div> |
|
|
<div id="wordclue" class="cluebox"> </div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td> |
|
|
</td> |
|
|
<?php |
|
|
<?php |
|
|
} |
|
|
} |
|
|