var enumtile = new Array(8); var img = new Array(8); var imgbrush = new Array(8); var mastergrid = new Array(10); var myreveal = new Array(10, 10); var mygrid = new Array(10); var shipcount = new Array(4); var brush = 1; var bWon = 0; var aiPopRow = new Array(10); var aiPopCol = new Array(10); var img_size = 32; for (x = 0; x < 10; x++) { mastergrid[x] = new Array(10); mygrid[x] = new Array(10); for (y = 0; y < 10; y++) { mastergrid[x][y] = 1; myreveal[x,y] = 0; } } enumtile[0] = "unknown"; img[0] = "small_unknown.gif"; imgbrush[0] = "small_unknown.gif"; enumtile[1] = "water"; img[1] = "small_water.gif"; imgbrush[1] = "small_water.gif"; enumtile[2] = "solo"; img[2] = "small_solo.gif"; imgbrush[2] = "small_solo.gif"; enumtile[3] = "middle"; img[3] = "small_middle.gif"; imgbrush[3] = "small_middle.gif"; enumtile[4] = "north"; img[4] = "small_north.gif"; imgbrush[4] = "small_north.gif"; enumtile[5] = "east"; img[5] = "small_east.gif"; imgbrush[5] = "small_east.gif"; enumtile[6] = "south"; img[6] = "small_south.gif"; imgbrush[6] = "small_south.gif"; enumtile[7] = "west"; img[7] = "small_west.gif"; imgbrush[7] = "small_west.gif"; aiPopRow[0] = 0; aiPopCol[0] = 0; aiPopRow[1] = 6; aiPopCol[1] = 3; aiPopRow[2] = 0; aiPopCol[2] = 1; aiPopRow[3] = 4; aiPopCol[3] = 5; aiPopRow[4] = 0; aiPopCol[4] = 2; aiPopRow[5] = 4; aiPopCol[5] = 1; aiPopRow[6] = 2; aiPopCol[6] = 2; aiPopRow[7] = 4; aiPopCol[7] = 1; aiPopRow[8] = 0; aiPopCol[8] = 3; aiPopRow[9] = 0; aiPopCol[9] = 2; mastergrid[1][1] = 7; mastergrid[1][5] = 4; mastergrid[1][6] = 6; mastergrid[2][1] = 3; mastergrid[3][1] = 3; mastergrid[3][3] = 7; mastergrid[3][5] = 4; mastergrid[3][6] = 3; mastergrid[3][7] = 6; mastergrid[4][1] = 5; mastergrid[4][3] = 5; mastergrid[5][5] = 2; mastergrid[6][1] = 2; mastergrid[6][7] = 7; mastergrid[7][7] = 3; mastergrid[8][1] = 2; mastergrid[8][3] = 7; mastergrid[8][7] = 5; mastergrid[9][3] = 5; mastergrid[9][5] = 2; document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln('
'); document.writeln('Instructions  |  '); document.writeln('Solution'); document.writeln('  |  Expand'); document.writeln('
'); document.writeln('
Daily Battleship Sudoku Puzzle
'); document.writeln('
'); document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
');document.writeln('
'); document.writeln('














'); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln('
Get Battleship Sudoku for your computer or Pocket PC
Get a Daily Battleship Sudoku Puzzle for your website
Visit www.DarkChrome.com
'); document.writeln('
'); ToStart(); RedrawCompletedShips(); brushChoice(5); function yourChoice(x,y) { if (bWon == 1) { } else { var gridxx = "grid"+x+y; document.images[gridxx].src = "http://www.darkchrome.com/dc/images/32/0/" + img[brush]; mygrid[x][y] = brush; RedrawCompletedShips(); CheckForWin(); if (bWon == 1) { alert("Congratulations! You have completed this Daily Battleship Sudoku puzzle. There will be another one coming along tomorrow, or visit www.darkchrome.com to get Battleship Sudoku for your PC or Pocket PC."); reveal(); } } } function brushChoice(newbrush) { document.images["brush"+brush].src = "http://www.darkchrome.com/dc/images/32/0/" + imgbrush[brush]; brush = newbrush; document.images["brush"+brush].src = "http://www.darkchrome.com/dc/images/32/0/high_" + imgbrush[brush]; } function CheckForWin() { bWon = 1; for (var x = 0; x < 10; x++) { for (var y = 0; y < 10; y++) { if (mastergrid[x][y] == 1 ) { if ( (!(mygrid[x][y] == 1)) && (!(mygrid[x][y] == 0)) ) { bWon = 0; } } else { if ( !(mastergrid[x][y] == mygrid[x][y]) ) { bWon = 0; } } } } } function RedrawCompletedShips() { CountCompletedShips(); for (var i = 0; i < 4; i++) { if (shipcount[i]>0) document.images["shipcount"+(i+1)].src = "http://www.darkchrome.com/dc/images/32/0/" + "small_"+shipcount[i]+".gif"; else document.images["shipcount"+(i+1)].src = "http://www.darkchrome.com/dc/images/32/0/" + "small_.gif"; } } function CountCompletedShips() { shipcount[0] = 4; shipcount[1] = 3; shipcount[2] = 2; shipcount[3] = 1; for (var x = 0; x < 10; x++) { for (var y = 0; y < 10; y++) { if (mygrid[x][y] == 2) shipcount[0] = shipcount[0] - 1; if (mygrid[x][y] == 4 && y < 9 && mygrid[x][y+1]==6 ) { shipcount[1] = shipcount[1] - 1; } if (mygrid[x][y] == 7 && x < 9 && mygrid[x+1][y]==5 ) { shipcount[1] = shipcount[1] - 1; } if (mygrid[x][y] == 4 && y < 8 && mygrid[x][y+1]==3 && mygrid[x][y+2]==6 ) { shipcount[2] = shipcount[2] - 1; } if (mygrid[x][y] == 7 && x < 8 && mygrid[x+1][y]==3 && mygrid[x+2][y]==5 ) { shipcount[2] = shipcount[2] - 1; } if (mygrid[x][y] == 4 && y < 7 && mygrid[x][y+1]==3 && mygrid[x][y+2]==3 && mygrid[x][y+3]==6 ) { shipcount[3] = shipcount[3] - 1; } if (mygrid[x][y] == 7 && x < 7 && mygrid[x+1][y]==3 && mygrid[x+2][y]==3 && mygrid[x+3][y]==5 ) { shipcount[3] = shipcount[3] - 1; } } } for (var i = 0; i < 4; i++) { if (shipcount[i] < 0) shipcount[i] = 0; } } function reveal() { bWon = 1; for (var x = 0; x < 10; x++) { for (var y = 0; y < 10; y++) { var gridxx = "grid"+x+y; document.images[gridxx].src = "http://www.darkchrome.com/dc/images/32/0/" + img[mastergrid[x][y]]; } } } function ToStart() { mygrid[0][0] = 0; document.images["grid00"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][1] = 0; document.images["grid01"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][2] = 0; document.images["grid02"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][3] = 0; document.images["grid03"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][4] = 0; document.images["grid04"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][5] = 0; document.images["grid05"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][6] = 0; document.images["grid06"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][7] = 0; document.images["grid07"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][8] = 0; document.images["grid08"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[0][9] = 0; document.images["grid09"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][0] = 0; document.images["grid10"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][1] = 0; document.images["grid11"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][2] = 0; document.images["grid12"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][3] = 0; document.images["grid13"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][4] = 0; document.images["grid14"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][5] = 0; document.images["grid15"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][6] = 0; document.images["grid16"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][7] = 0; document.images["grid17"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][8] = 0; document.images["grid18"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[1][9] = 0; document.images["grid19"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][0] = 0; document.images["grid20"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][1] = 0; document.images["grid21"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][2] = 0; document.images["grid22"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][3] = 0; document.images["grid23"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][4] = 0; document.images["grid24"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][5] = 0; document.images["grid25"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][6] = 0; document.images["grid26"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][7] = 0; document.images["grid27"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][8] = 0; document.images["grid28"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[2][9] = 0; document.images["grid29"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][0] = 0; document.images["grid30"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][1] = 0; document.images["grid31"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][2] = 0; document.images["grid32"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][3] = 0; document.images["grid33"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][4] = 0; document.images["grid34"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][5] = 0; document.images["grid35"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][6] = 0; document.images["grid36"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][7] = 0; document.images["grid37"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][8] = 0; document.images["grid38"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[3][9] = 0; document.images["grid39"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][0] = 0; document.images["grid40"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][1] = 0; document.images["grid41"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][2] = 0; document.images["grid42"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][3] = 0; document.images["grid43"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][4] = 0; document.images["grid44"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][5] = 0; document.images["grid45"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][6] = 0; document.images["grid46"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][7] = 0; document.images["grid47"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][8] = 0; document.images["grid48"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[4][9] = 0; document.images["grid49"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][0] = 0; document.images["grid50"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][1] = 0; document.images["grid51"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][2] = 0; document.images["grid52"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][3] = 0; document.images["grid53"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][4] = 0; document.images["grid54"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][5] = 2; document.images["grid55"].src = "http://www.darkchrome.com/dc/images/32/0/high_small_solo.gif"; mygrid[5][6] = 0; document.images["grid56"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][7] = 0; document.images["grid57"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][8] = 0; document.images["grid58"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[5][9] = 0; document.images["grid59"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][0] = 0; document.images["grid60"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][1] = 0; document.images["grid61"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][2] = 0; document.images["grid62"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][3] = 0; document.images["grid63"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][4] = 0; document.images["grid64"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][5] = 0; document.images["grid65"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][6] = 0; document.images["grid66"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][7] = 0; document.images["grid67"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][8] = 0; document.images["grid68"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[6][9] = 0; document.images["grid69"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][0] = 0; document.images["grid70"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][1] = 0; document.images["grid71"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][2] = 0; document.images["grid72"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][3] = 0; document.images["grid73"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][4] = 0; document.images["grid74"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][5] = 0; document.images["grid75"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][6] = 0; document.images["grid76"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][7] = 3; document.images["grid77"].src = "http://www.darkchrome.com/dc/images/32/0/high_small_middle.gif"; mygrid[7][8] = 0; document.images["grid78"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[7][9] = 0; document.images["grid79"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][0] = 0; document.images["grid80"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][1] = 2; document.images["grid81"].src = "http://www.darkchrome.com/dc/images/32/0/high_small_solo.gif"; mygrid[8][2] = 0; document.images["grid82"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][3] = 7; document.images["grid83"].src = "http://www.darkchrome.com/dc/images/32/0/high_small_west.gif"; mygrid[8][4] = 0; document.images["grid84"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][5] = 0; document.images["grid85"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][6] = 0; document.images["grid86"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][7] = 0; document.images["grid87"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][8] = 0; document.images["grid88"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[8][9] = 0; document.images["grid89"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][0] = 0; document.images["grid90"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][1] = 0; document.images["grid91"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][2] = 0; document.images["grid92"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][3] = 0; document.images["grid93"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][4] = 0; document.images["grid94"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][5] = 0; document.images["grid95"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][6] = 0; document.images["grid96"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][7] = 0; document.images["grid97"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][8] = 0; document.images["grid98"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; mygrid[9][9] = 0; document.images["grid99"].src = "http://www.darkchrome.com/dc/images/32/0/small_unknown.gif"; }