<html>
<head>
<meta charset="utf-8">
<title>Cross word Puzzel by Dasari</title>
</head>
<body>
<center>
<div>
</div>
<div class="grid">
<div id="cross word">
<style>
.grid {
width: 305px;
height: 370px;
margin: 0 auto;
background-color: deepskyblue;
padding: 10px 10px 10px 10px;
border-radius: 30px;
border: 2px solid deeppink;
box-shadow: 10px 15px 5px #cbcbcb;
}
h2{
background-color:deepskyblue;
color:white;
text-align:center;
width:150px;
margin:20 auto;
margin-top:2;
padding: 0px 0px;
border-radius: 10px;
}
#cross{
text-align: center;
width:30px;
height:30px;
margin: 0;
padding: 0;
border-collapse: collapse;
border: 10px solid white;
}
#buttons{
width:30%;
float: right;
}
tr{
margin: 0;
padding: 0;
border-collapse: collapse;
}
td{
height: 30px;
width: 30px;
}
#leftBox{
float: left;
}
#rightBox{
float: left;
clear:left;
background-color:aqua;
border-radius:8px;
margin-top:5px;
margin-right:7px;
}
.butt{
height:30;
width: 65px;
background-color:skyblue;
hover:blue;
padding: 1px 0px;
border-radius: 10px;
}
#puzzel{
text-align: center;
margin: 0;
padding: 0;
border-collapse: collapse;
border: 10px grey;
}
.inputBox{
width: 30px;
height:30px;
background-color:white;
border: 3px green;
text-align: center;
}
#hintsTable{
width: 480px;
float: row;
margin:2px;
clear: left;
}
#puzzel {
width:100%;
margin: 0;
padding: 0;
border-collapse: collapse;
border: 8px solid grey;
border-radius:1px;
}
#cross{
text-align: center;
width:30px;
height:30px;
margin: 0;
padding: 0;
border-collapse: collapse;
border: 1px solid white;
}
#buttons{
width:30%;
float: right;
}
tr{
margin: 0;
padding: 0;
border-collapse: collapse;
}
#leftBox{
float:center;
width:50%
height:50%;
}
#rightBox{
float:center;
}
#butt{
width: 100px;
padding:20px;
}
table{
padding:10px;
}
footer{
color:blue;
text-align:right;
border-radius:5px;
}
hr{
size="5"
color="deeppink"
}
</style>
<script>
//Globals
var currentTextInput;
var puzzelArrayData;
//Loads the Crossword
function initializeScreen(){
var puzzelTable = document.getElementById("puzzel");
puzzelArrayData = preparePuzzelArray();
for ( var i = 0; i < puzzelArrayData.length ; i++ ) {
var row = puzzelTable.insertRow(-1);
var rowData = puzzelArrayData[i];
for(var j = 0 ; j < rowData.length ; j++){
var cell = row.insertCell(-1);
if(rowData[j] != 0){
var txtID = String('txt' + '_' + i + '_' + j);
cell.innerHTML = '<input type="text" class="inputBox" maxlength="7" style="text-transform: lowercase" ' + 'id="' + txtID + '" onfocus="textInputFocus(' + "'" + txtID + "'"+ ')">';
}else{
cell.style.backgroundColor = "black";
}
}
}
addHint();
}
//Adds the hint numbers
function addHint(){
document.getElementById("txt_0_1").placeholder = "1";
document.getElementById("txt_0_2").placeholder = "2";
document.getElementById("txt_0_3").placeholder = "3";
document.getElementById("txt_0_5").placeholder = "4";
document.getElementById("txt_0_6").placeholder = "5";
document.getElementById("txt_1_0").placeholder = "6";
document.getElementById("txt_1_2").placeholder = "7";
document.getElementById("txt_1_8").placeholder = "8";
document.getElementById("txt_2_0").placeholder = "9";
document.getElementById("txt_2_7").placeholder = "10";
document.getElementById("txt_3_2").placeholder = "11";
document.getElementById("txt_3_5").placeholder = "12";
document.getElementById("txt_3_6").placeholder = "13";
document.getElementById("txt_4_1").placeholder = "14";
document.getElementById("txt_4_4").placeholder = "15";
document.getElementById("txt_4_6").placeholder = "16";
document.getElementById("txt_5_0").placeholder = "17";
document.getElementById("txt_5_2").placeholder = "18";
document.getElementById("txt_5_3").placeholder = "19";
document.getElementById("txt_5_5").placeholder = "20";
document.getElementById("txt_5_8").placeholder = "21";
document.getElementById("txt_6_0").placeholder = "22";
document.getElementById("txt_6_7").placeholder = "23";
document.getElementById("txt_7_2").placeholder = "24";
document.getElementById("txt_7_6").placeholder = "25";
document.getElementById("txt_8_1").placeholder = "26";
document.getElementById("txt_8_5").placeholder = "27";
}
//Stores ID of the selected cell into currentTextInput
function textInputFocus(txtID123){
currentTextInput = txtID123;
}
//Returns Array
function preparePuzzelArray(){
var items = [ [0, 'స', 'న్ను', 'తి', 0, 'ప', 'నో' , 'డు', 0,],
['బె', 0, 'మ', 'క', 'రం ', 'ద', 'ము', 0, 'చా'],
['రు', 'మ', 0, 'మ', 0, 'ని', 0, 'భో', 'గం'],
['కు', 0, 'కో ', 'క', 0, 'స', 'నం', 0, 'టి'],
[0, 'ఉ', 'మ', 0, 'నో', 0, 'డూ', 'డూ', 0],
['వా', 0, 'లి', 'ఆ', 0, 'నా', 'రి', 0, 'ఎ'],
['వి', 'ధి', 0, 'ప', 0, 'ర', 0, 'బా', 'లు'],
['లి', 0, 'కొ', 'ద', 'మ', 'సిం', 'హం', 0, 'క'],
[0, 'బొ', 'మ్మ', 'లు', 0, 'హా', 'స', 'ము', 0],
];
return items;
}
//Clear All Button
function clearAllClicked(){
currentTextInput = '';
var puzzelTable = document.getElementById("puzzel");
puzzelTable.innerHTML = '';
initializeScreen();
}
//Check button
function checkClicked(){
for ( var i = 0; i < puzzelArrayData.length ; i++ ) {
var rowData = puzzelArrayData[i];
for(var j = 0 ; j < rowData.length ; j++){
if(rowData[j] != 0){
var selectedInputTextElement = document.getElementById('txt' + '_' + i + '_' + j);
if(selectedInputTextElement.value != puzzelArrayData[i][j]){
selectedInputTextElement.style.backgroundColor = 'red';
}else{
selectedInputTextElement.style.backgroundColor = 'white';
}
}
}
}
}
//Clue Button
function clueClicked(){
if (currentTextInput != null){
var temp1 = currentTextInput;
var token = temp1.split("_");
var row = token[1];
var column = token[2];
document.getElementById(temp1).value = puzzelArrayData[row][column];
//checkClicked();
}
}
//Solve Button
function solveClicked(){
if (currentTextInput != null){
var temp1 = currentTextInput;
var token = temp1.split("_");
var row = token[1];
var column = token[2];
// Print elements on top
for(j = row; j >= 0; j--){
if(puzzelArrayData[j][column] != 0){
document.getElementById('txt' + '_' + j + '_' + column).value = puzzelArrayData[j][column];
}else break;
}
// Print elements on right
for(i = column; i< puzzelArrayData[row].length; i++){
if(puzzelArrayData[row][i] != 0){
document.getElementById('txt' + '_' + row + '_' + i).value = puzzelArrayData[row][i];
}else break;
}
// Print elements below
for(m = row; m< puzzelArrayData.length; m++){
if(puzzelArrayData[m][column] != 0){
document.getElementById('txt' + '_' + m + '_' + column).value = puzzelArrayData[m][column];
}else break;
}
// Print elements on left
for(k = column; k >= 0; k--){
if(puzzelArrayData[row][k] != 0){
document.getElementById('txt' + '_' + row + '_' + k).value = puzzelArrayData[row][k];
}else break;
}
// Done!
}
}
const puzzleText = `
======REPLACE WITH YOUR PUZZLE BELOW======
exolve-begin
exolve-width: 3
exolve-height: 3
exolve-grid:
ACE
R.R
EAR
exolve-across:
1 Clue for ACE (3)
3 Clue for EAR (3)
exolve-down
1 Clue for ARE (3)
2 Clue for ERR (3)
exolve-end
======REPLACE WITH YOUR PUZZLE ABOVE======
`;
</script>
</head>
<body onload="initializeScreen()">
<div id="leftBox">
<table id="puzzel">
</table>
</div>
<div id="rightBox">
<table>
<tr><td><input class="butt" type="submit" value="Clear All" onclick="clearAllClicked()"></td>
<td><input class="butt" type="submit" value="Check" onclick="checkClicked()"></td>
<td><input class="butt" type="submit" value="Solve" onclick="solveClicked()"></td>
<td><input class="butt" type="submit" value="Clue" onclick="clueClicked()"></td></tr>
</table>
</div>
</body>
</html>
పదకేళి-2
ఆధారాలు:అడ్డం:
1. స్తుతించడం (4)
4. మన పని చేసేవాడు.. కానీ మనోడు కాదు (3) ..
7. పూదేనె.. మొసలి ముందుంది (4)
9 . ఆదివారంలో మండే సూర్యుడు (2)
10. విలాసం (2) 11. చుట్టూ చెంగావి 'చీర' (2)
12. 'ఓర్పు'లో మధ్యవర్తి మాయం (2)
14. పరమశివుని భార్య (2))
16. గంగిరెద్దులా తలూపడం, .....బసవన్నా(2)
18. భార్య అలిగి తిరగబడింది(2) 20. వింటికి కట్టే తాడు (2) 22.ఈ రాత నుంచి తప్పించుకోవడం సాధ్యం కాదు (2)
23. గాన గంధర్వుడు (2) 24. కుర్ర సింహం (5)
26. కొండపల్లి వీటి తయారీలో ప్రసిద్ధి (3)
27 . నవ్వు (3)
నిలువు :
2. ఇది తిన్నాడని కన్నయ్యను యశోద మందలించింది.. కింది నుంచి పైకి (2)
3. గందరగోళ పడడం(4)
4. సప్తస్వరాల్లో ఇవి కొన్ని(4)
5.పెళ్ళయిన ఆడవాళ్ళు భర్త కోసం చేసే పూజ (2)
6.పిరికి వాడికి ఉండేది (3)
8. ఈయన ప్రవచనం చెప్పడంలో మేటి (3)
11. సుకుమారి, అందమైన స్త్రీ మూర్తి(3)
13. ఎంకిని ప్రేమించిన కవి (3)
14. వాలి మధ్యలో వి చేరితే
19. వెళ్ళు.. నీ ముందు ఆ చేరితే ప్రమాదాలు (4)
20.కేశవ నామాలలో ఒకటి(4)
21. దీన్ని పట్టడానికి కొండను తవ్వాలా? (4)
24.కొమ్ము లో చివరి అచ్చు విరిగిపోయింది (2)
25. లాక్టోమీటర్ కలిగిన పక్షి (2)
Comments
Post a Comment