Skip to content

Commit

Permalink
Basic code added
Browse files Browse the repository at this point in the history
  • Loading branch information
System05Pentium committed Nov 12, 2024
1 parent 728ff5b commit 4f39990
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Script.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ async function nextMove(row,col){
return true
}
nextobject.classList.remove("Path");
nextobject.classList.add("wrong");
}
return false
}
Expand All @@ -121,7 +122,7 @@ function nonWall(row,col){
for(let i=0;i<nextvalue.length;i++){
if(nextvalue[i][0]>=0 && nextvalue[i][1]>=0){
let object=document.getElementById((nextvalue[i][0])+","+(nextvalue[i][1]));
if(!(object.classList.contains('wall'))&& !(object.classList.contains('Path'))){
if(!(object.classList.contains('wall'))&& !(object.classList.contains('Path'))&& !(object.classList.contains('wrong'))){
NoWalls.push([nextvalue[i][0],nextvalue[i][1]])
}
}
Expand Down Expand Up @@ -161,6 +162,12 @@ function resetall(){
objects=document.querySelectorAll(".Path");
objects.forEach((elemant)=>{
elemant.classList.remove('Path')

})
objects=document.querySelectorAll(".wrong");
objects.forEach((elemant)=>{
elemant.classList.remove('wrong')

})
}
}
Expand Down
5 changes: 4 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ h1{
background-color: green !important;
}
.Path{
background-color: yellow !important;
background-color: yellow;
animation: pathinsert .4s ease-in-out forwards ;

}
Expand Down Expand Up @@ -102,4 +102,7 @@ h1{
}
.solver:active{
transform: scale(0.96);
}
.wrong{
background-color: rgb(255, 201, 201) !important;
}

0 comments on commit 4f39990

Please sign in to comment.