I have a script and I ran it and it just seems to stop. The reason I
say so is that the script does not get to the second alert. OK here it
is:
function show(input) {
if (input.length == 1) {
for (i=0;i<input[0].length;i++) {
document.write( input[0][i]);
}
document.write( "<br>");
} else {
for (i=0;i<input.le ngth;i++) {
for (j=0;j<input[0].length;j++) {
document.write( input[i][j]);
}
document.write( "<br>");
}
}
}
function squareroot(inpu t) {
output = copy2darr(input );
alert(output.jo in("\n"));
top = new Array(output[0].length);
alert(output.jo in("\n")); // This is the alert it never gets to
for (var i=0;i<output[0].length;i++) {
top[i] = "";
}
alert(top);
n = output.unshift( top);
alert(output.jo in("\n"));
for (var i=0;i<output.le ngth;i++) {
if (i == 0) {
n = output[i].unshift("┌");
} else {
n = output[i].unshift("│");
}
}
for (var i=0;i<output.le ngth;i++) {
if (i != output.length-1) {
n = output[i].unshift(" ");
} else {
n = output[i].unshift("\\");
}
}
return output;
}
document.write( "long hyphen: <br>leftmo st peice:
┌<br>right most peice: ┐<br>talle r bar: │<br>squar e
root symbol: √<br><br>" );
arr = [
[" ","5"," "," "," "," "],
["x"," "," ","+"," ","x"]];
show(arr);
show(squareroot (arr));
say so is that the script does not get to the second alert. OK here it
is:
function show(input) {
if (input.length == 1) {
for (i=0;i<input[0].length;i++) {
document.write( input[0][i]);
}
document.write( "<br>");
} else {
for (i=0;i<input.le ngth;i++) {
for (j=0;j<input[0].length;j++) {
document.write( input[i][j]);
}
document.write( "<br>");
}
}
}
function squareroot(inpu t) {
output = copy2darr(input );
alert(output.jo in("\n"));
top = new Array(output[0].length);
alert(output.jo in("\n")); // This is the alert it never gets to
for (var i=0;i<output[0].length;i++) {
top[i] = "";
}
alert(top);
n = output.unshift( top);
alert(output.jo in("\n"));
for (var i=0;i<output.le ngth;i++) {
if (i == 0) {
n = output[i].unshift("┌");
} else {
n = output[i].unshift("│");
}
}
for (var i=0;i<output.le ngth;i++) {
if (i != output.length-1) {
n = output[i].unshift(" ");
} else {
n = output[i].unshift("\\");
}
}
return output;
}
document.write( "long hyphen: <br>leftmo st peice:
┌<br>right most peice: ┐<br>talle r bar: │<br>squar e
root symbol: √<br><br>" );
arr = [
[" ","5"," "," "," "," "],
["x"," "," ","+"," ","x"]];
show(arr);
show(squareroot (arr));
Comment