Sudoku checker by ayush The Next CEO of Stack OverflowjQuery plugin $(node).toJSON() - convert html form to JS ObjectSudoku Week-End Challenge - Brute-Force Recursive solverInteractive sliderSudoku Checker in JavaInterupt redirect to catch potential newsletter signupUsing/storing server-side data on the client sideRecursive Sudoku SolverEnabling or disabling input fieldsSudoku puzzle solving algorithm that uses a rule-based approach to narrow the depth searchHTML/Javascript Hex to RGB and RGB to Hex Color Converter
declare as function pointer and initialize in the same line
What's the point of interval inversion?
What is the point of a new vote on May's deal when the indicative votes suggest she will not win?
What is meant by a M next to a roman numeral?
suction cup thing with 1/4 TRS cable?
Why here is plural "We went to the movies last night."
Horror movie/show or scene where a horse creature opens its mouth really wide and devours a man in a stables
Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?
Bulk API v2 Get Job Status Failing - InvalidBatch : Field name not found
How do scammers retract money, while you can’t?
Why were Madagascar and New Zealand discovered so late?
Implement the Thanos sorting algorithm
Rotate a column
Explicit solution of a Hamiltonian system
How to safely derail a train during transit?
What does this shorthand mean?
Why do remote companies require working in the US?
Why do professional authors make "consistency" mistakes? And how to avoid them?
MAZDA 3 2006 (UK) - poor acceleration then takes off at 3250 revs
Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?
What is the difference between "behavior" and "behaviour"?
Is a stroke of luck acceptable after a series of unfavorable events?
How do we know the LHC results are robust?
Inappropriate reference requests from Journal reviewers
Sudoku checker by ayush
The Next CEO of Stack OverflowjQuery plugin $(node).toJSON() - convert html form to JS ObjectSudoku Week-End Challenge - Brute-Force Recursive solverInteractive sliderSudoku Checker in JavaInterupt redirect to catch potential newsletter signupUsing/storing server-side data on the client sideRecursive Sudoku SolverEnabling or disabling input fieldsSudoku puzzle solving algorithm that uses a rule-based approach to narrow the depth searchHTML/Javascript Hex to RGB and RGB to Hex Color Converter
$begingroup$
I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button? I only have until april 9th to finish.
<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
var puzzle = new Array(9);
for (i=0; i < 9; i++)
puzzle[i]=new Array(9);
// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA
function ReadCells()
var cell;
document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
// clears the Sudoku form
function ClearPuzzle(form)
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form)
document.getElementById('OutputText').value = "";
// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>
html sudoku
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button? I only have until april 9th to finish.
<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
var puzzle = new Array(9);
for (i=0; i < 9; i++)
puzzle[i]=new Array(9);
// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA
function ReadCells()
var cell;
document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
// clears the Sudoku form
function ClearPuzzle(form)
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form)
document.getElementById('OutputText').value = "";
// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>
html sudoku
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button? I only have until april 9th to finish.
<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
var puzzle = new Array(9);
for (i=0; i < 9; i++)
puzzle[i]=new Array(9);
// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA
function ReadCells()
var cell;
document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
// clears the Sudoku form
function ClearPuzzle(form)
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form)
document.getElementById('OutputText').value = "";
// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>
html sudoku
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I have my general code but don't know how to add a function for my check answer button. Can somebody help me make a function for my check answer button? I only have until april 9th to finish.
<!-- Sudoku checking thing -->
<HTML>
<HEAD>
<TITLE>Ayush & Ranveer's sudoku checker</TITLE>
</HEAD>
<BODY>
<form method="post" name="Sudoku">
<input id="C1_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="1" type="TEXT">
<input id="C1_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C1_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C1_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C1_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C1_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C1_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<br>
<input id="C2_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C2_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C2_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C2_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C2_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C2_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C2_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C3_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C3_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C3_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C3_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C3_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C3_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C3_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<br>
<input id="C4_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="3" type="TEXT">
<input id="C4_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C4_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C4_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C4_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C4_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C4_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C5_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="5" type="TEXT">
<input id="C5_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C5_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C5_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C5_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C5_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C5_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<br>
<input id="C6_1" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_2" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C6_3" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_4" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C6_5" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C6_6" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C6_7" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C6_8" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="6" type="TEXT">
<input id="C6_9" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<br>
<input id="C7_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="3" type="TEXT">
<input id="C7_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="5" type="TEXT">
<input id="C7_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="7" type="TEXT">
<input id="C7_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C7_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C7_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C7_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<br>
<input id="C8_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="7" type="TEXT">
<input id="C8_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="9" type="TEXT">
<input id="C8_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C8_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="2" type="TEXT">
<input id="C8_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C8_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="4" type="TEXT">
<input id="C8_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<br>
<input id="C9_1" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="9" type="TEXT">
<input id="C9_2" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_3" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="2" type="TEXT">
<input id="C9_4" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_5" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="4" type="TEXT">
<input id="C9_6" maxlength="1" size="1" style="BACKGROUND-COLOR:ORANGE;" value="" type="TEXT">
<input id="C9_7" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="6" type="TEXT">
<input id="C9_8" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="" type="TEXT">
<input id="C9_9" maxlength="1" size="1" style="BACKGROUND-COLOR:LIME;" value="8" type="TEXT">
<br>
<br>
<INPUT TYPE="button" VALUE="Read Cells" NAME="ReadCellsButton" onClick="ReadCells()">
<INPUT TYPE="button" VALUE="Restore Cells" NAME="RestoreCellsButton" onClick="RestoreCells()">
<INPUT TYPE="button" VALUE="Clear Puzzle" NAME="ClearPuzzleButton" onClick="ClearPuzzle()">
<INPUT TYPE="button" VALUE="Clear Text Area" NAME="ClearTextareaButton" onClick="ClearTextArea()">
<INPUT TYPE="button" VALUE="Check Answer" NAME="CheckAnswer" onClick="CheckAnswer()">
<textarea id="OutputText" rows="10" cols="80" readonly></textarea>
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript -
var puzzle = new Array(9);
for (i=0; i < 9; i++)
puzzle[i]=new Array(9);
// reads values from the Sudoku form, stores them in the puzzle[][] array,
// and writes them to the OutputText TEXTAREA
function ReadCells()
var cell;
document.getElementById('OutputText').value = "ReadCells():n";
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
puzzle[i-1][j-1] = document.getElementById(cell).value;
document.getElementById('OutputText').value += puzzle[i-1].join(" ");
document.getElementById('OutputText').value += "n";
// writes values from the puzzle[][] array to the Sudoku form
function RestoreCells()
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = puzzle[i-1][j-1];
// clears the Sudoku form
function ClearPuzzle(form)
var cell;
for(i = 1; i <= 9; i++)
for(j = 1; j <= 9; j++)
cell = "C" + i + "_" + j;
document.getElementById(cell).value = "";
// clears the TEXTAREA below the Sudoku puzzle
function ClearTextArea(form)
document.getElementById('OutputText').value = "";
// - End of JavaScript - -->
</SCRIPT>
<BODY>
</HTML>
html sudoku
html sudoku
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 4 mins ago
AyushAyush
1
1
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Ayush is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Ayush is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f216450%2fsudoku-checker-by-ayush%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Ayush is a new contributor. Be nice, and check out our Code of Conduct.
Ayush is a new contributor. Be nice, and check out our Code of Conduct.
Ayush is a new contributor. Be nice, and check out our Code of Conduct.
Ayush is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f216450%2fsudoku-checker-by-ayush%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown