NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

SUDOKU CON GRIGLIE E QUADRANTI (cambiare numeri di input nel codice html)

HTML

<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
<div id="centro">
<h1>
SUDOKU (Medio)
</h1>
<br><br><br>
</div>
<div id=divpr>
<div id="div1">
<table cellpadding="8" border="1">
<tr>
<td> 9 </td>
<td> 5 </td>
<td> <input id="in1" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in2" size="1" maxlength="3"> </td>
<td> <input id="in3" size="1" maxlength="3"> </td>
<td> 6 </td>
</tr>
<tr>
<td> <input id="in4" size="1" maxlength="3"> </td>
<td> <input id="in5" size="1" maxlength="3"> </td>
<td> <input id="in6" size="1" maxlength="3"> </td>
</tr>
</table>
</div>
<div id="div1">
<table cellpadding="9" border="1">
<tr>
<td> <input id="in7" size="1" maxlength="3"> </td>
<td> <input id="in8" size="1" maxlength="3"> </td>
<td> <input id="in9" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in10" size="1" maxlength="3"> </td>
<td> <input id="in11" size="1" maxlength="3"> </td>
<td> <input id="in12" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> 6 </td>
<td> 7 </td>
<td> 5 </td>
</tr>
</table>
</div>
<div id="div1">
<table cellpadding="8" border="1">
<tr>
<td> <input id="in13" size="1" maxlength="3"> </td>
<td> <input id="in14" size="1" maxlength="3"> </td>
<td> <input id="in15" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> 4 </td>
<td> <input id="in16" size="1" maxlength="3"> </td>
<td> <input id="in17" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in18" size="1" maxlength="3"> </td>
<td> <input id="in19" size="1" maxlength="3"> </td>
<td> <input id="in20" size="1" maxlength="3"> </td>
</tr>
</table>
</div>
<br>
<div id="div1">
<table cellpadding="8" border="1">
<tr>
<td> <input id="in21" size="1" maxlength="3"> </td>
<td> <input id="in22" size="1" maxlength="3"> </td>
<td> <input id="in23" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in24" size="1" maxlength="3"> </td>
<td> 7 </td>
<td> 4 </td>
</tr>
<tr>
<td> <input id="in25" size="1" maxlength="3"> </td>
<td> <input id="in26" size="1" maxlength="3"> </td>
<td> <input id="in27" size="1" maxlength="3"> </td>
</tr>
</table>
</div>
<div id="div1">
<table cellpadding="8" border="1">
<tr>
<td> 5 </td>
<td> <input id="in28" size="1" maxlength="3"> </td>
<td> <input id="in29" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> 1 </td>
<td> 6 </td>
<td> <input id="in30" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in31" size="1" maxlength="3"> </td>
<td> <input id="in32" size="1" maxlength="3"> </td>
<td> 9 </td>
</tr>
</table>
</div>
<div id="div1">
<table cellpadding="9" border="1">
<tr>
<td> 6 </td>
<td> 2 </td>
<td> 3 </td>
</tr>
<tr>
<td> 5 </td>
<td> <input id="in33" size="1" maxlength="3"> </td>
<td> <input id="in34" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in35" size="1" maxlength="3"> </td>
<td> <input id="in36" size="1" maxlength="3"> </td>



<td> <input id="in37" size="1" maxlength="3"> </td>
</tr>
</table>
</div>
<br>
<div id="div1">
<table cellpadding="8">
<tr>
<td> <input id="in38" size="1" maxlength="3"> </td>
<td> 4 </td>
<td> 5 </td>
</tr>
<tr>
<td> <input id="in39" size="1" maxlength="3"> </td>
<td> <input id="in40" size="1" maxlength="3"> </td>
<td size="5"> </td>
</tr>
<tr>
<td> 7 </td>
<td> <input id="in41" size="1" maxlength="3"> </td>
<td> 2 </td>
</tr>
</table>
</div>
<div id="div1">
<table cellpadding="8" border="1">
<tr>
<td> 7 </td>
<td> <input id="in42" size="1" maxlength="3"> </td>
<td> <input id="in43" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in44" size="1" maxlength="3"> </td>
<td> <input id="in45" size="1" maxlength="3"> </td>



<td> <input id="in46" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in47" size="1" maxlength="3"> </td>
<td> 9 </td>
<td> 8 </td>
</tr>
</table>
</div>
<div id="div1">
<table cellpadding="8" border="1">
<tr>
<td> <input id="in48" size="1" maxlength="3"> </td>
<td> 9 </td>
<td> <input id="in49" size="1" maxlength="3"> </td>
</tr>
<tr>
<td> <input id="in50" size="1" maxlength="3"> </td>
<td> <input id="in51" size="1" maxlength="3"> </td>
<td> 2 </td>
</tr>
<tr>
<td> 3 </td>
<td> <input id="in52" size="1" maxlength="3"> </td>
<td> <input id="in53" size="1" maxlength="3"> </td>
</tr>
</table>
</div>
</div>
<br><br><br><br>
<p id="scr">
Se pensi di aver completato correttamente il sudoku, clicca sul pulsante :
</p>
<div id="centro">
<button id="btn1" class="btn btn-primary" onclick="sudoku()"> CLICCAMI
</button>
</div>
<br>
<div id="centro">
<p id="p1">
</p>
</div>
</body>
</html>

------

CSS

h1 {
color : aqua;
border:solid 5px red;
background-color : green;
display: inline-block;
font-size: 40;
}
#centro {
text-align: center;
}
table {
border: 2px solid;
border-collapse: collapse;
}
td {
border : 1px solid gray;
}
#div1 {
display: inline-block;
}
#divpr {
border: solid yellow;
display: inline-block;
}
#scr {
font-size: 20;
font-family : fantasy;
color:brown;
}
#p1 {
font-family: fantasy;
font-size: 18;
}
table {
display : inline-block;
}
td{
width: 67px;
}

---------

JAVASCRIPT

function sudoku () {
var x = ''
let a1 = document.getElementById("in1").value;
let a2 = document.getElementById("in2").value;
let a3 = document.getElementById("in3").value;
let a4 = document.getElementById("in4").value;
let a5 = document.getElementById("in5").value;
let a6 = document.getElementById("in6").value;
let a7 = document.getElementById("in7").value;
let a8 = document.getElementById("in8").value;
let a9 = document.getElementById("in9").value;
let a10 = document.getElementById("in10").value;
let a11 = document.getElementById("in11").value;
let a12 = document.getElementById("in12").value;
let a13 = document.getElementById("in13").value;
let a14 = document.getElementById("in14").value;
let a15 = document.getElementById("in15").value;
let a16 = document.getElementById("in16").value;
let a17 = document.getElementById("in17").value;
let a18 = document.getElementById("in18").value;
let a19 = document.getElementById("in19").value;
let a20 = document.getElementById("in20").value;
let a21 = document.getElementById("in21").value;
let a22 = document.getElementById("in22").value;
let a23 = document.getElementById("in23").value;
let a24 = document.getElementById("in24").value;
let a25 = document.getElementById("in25").value;
let a26 = document.getElementById("in26").value;
let a27 = document.getElementById("in27").value;
let a28 = document.getElementById("in28").value;
let a29 = document.getElementById("in29").value;
let a30 = document.getElementById("in30").value;
let a31 = document.getElementById("in31").value;
let a32 = document.getElementById("in32").value;
let a33 = document.getElementById("in33").value;
let a34 = document.getElementById("in34").value;
let a35 = document.getElementById("in35").value;
let a36 = document.getElementById("in36").value;
let a37 = document.getElementById("in37").value;
let a38 = document.getElementById("in38").value;
let a39 = document.getElementById("in39").value;
let a40 = document.getElementById("in40").value;
let a41 = document.getElementById("in41").value;
let a42 = document.getElementById("in42").value;
let a43 = document.getElementById("in43").value;
let a44 = document.getElementById("in44").value;
let a45 = document.getElementById("in45").value;
let a46 = document.getElementById("in46").value;
let a47 = document.getElementById("in47").value;
let a48 = document.getElementById("in48").value;
let a49 = document.getElementById("in49").value;
let a50 = document.getElementById("in50").value;
let a51 = document.getElementById("in51").value;
let a52 = document.getElementById("in52").value;
let a53 = document.getElementById("in53").value;

if (a1==7 && a2==8 && a3==3 && a4==4 && a5==2 && a6==1 && a7==6 && a8==8 && a9==3 && a10==9 && a11==1 && a12==2 && a13==5 && a14==7 && a15==4 && a16==2 && a17==1 && a18==9 && a19==3 && a20==8 && a21==1 && a22==9 && a23==8 && a24==4 && a25==7 && a26==2 && a27==3 && a28==8 && a29==9 && a30==5 && a31==6 && a32==3 && a33==2 && a34==8 && a35==1 && a36==7 && a37==4 && a38==3 && a39==2 && a40==6 && a41==8 && a42==1 && a43==6 && a44==8 && a45==3 && a46==5 && a47==1 && a48==7 && a49==4 && a50==1 && a51==4 && a52==6 && a53==5) {
x = document.getElementById("p1");
x.innerHTML = "Sudoku corretto!!!";
x.style.color= "green";
}
else {
x = document.getElementById("p1");
x.innerHTML = "Sudoku errato";
x.style.color= "red";
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.