This is the code I wrote up to display a Mancala board but it won't display the leading space for some reason. Does anyone know why this is happening? Any help is greatly appreciated.
function display(board)
{
var space = " ";
document.write(space);
for (var i=0;i<board.length/2;i=i+1)
{
document.writeln(board[i]);
}
document.write("<BR>");
for (var i=board.length-1;i >= board.length/2;i=i-1)
{
document.writeln(board[i]);
}
}
edit: For whatever reason the code doesn't seem to display properly but the important part is the document.write(space) command.