diff --git a/Games/Game_01/README.md b/Games/Game_01/README.md new file mode 100644 index 00000000..8b142838 --- /dev/null +++ b/Games/Game_01/README.md @@ -0,0 +1,4 @@ + + +https://user-images.githubusercontent.com/89895559/148755705-4ddf9cf7-bc77-42d4-a912-962035dbafe7.mp4 + diff --git a/Games/Game_01/assets/index.js b/Games/Game_01/assets/index.js new file mode 100644 index 00000000..7620991e --- /dev/null +++ b/Games/Game_01/assets/index.js @@ -0,0 +1,225 @@ +const easy = [ + "6------7------5-2------1---362----81--96-----71--9-4-5-2---651---78----345-------", + "685329174971485326234761859362574981549618732718293465823946517197852643456137298" + ]; + const medium = [ + "--9-------4----6-758-31----15--4-36-------4-8----9-------75----3-------1--2--3--", + "619472583243985617587316924158247369926531478734698152891754236365829741472163895" + ]; + const hard = [ + "-1-5-------97-42----5----7-5---3---7-6--2-41---8--5---1-4------2-3-----9-7----8--", + "712583694639714258845269173521436987367928415498175326184697532253841769976352841" + ]; + var timer; + var timeRemaining; + var lives; + var selectedNum; + var selectedTiles; + var disableSelect; + window.onload=function(){ + + +id("start").addEventListener("click",startGame); +for(let i=0;i17 && tile.id<27)||(tile.id>44 && tile.id<54)){ + tile.classList.add("bottomborder"); + } + if((tile.id+1)%9==3 ||(tile.id+1)%9==6 ){ + tile.classList.add("rightborder"); + } + id("board").appendChild(tile); + } + + +} + +function updateMove(){ + if(selectedTiles && selectedNum){ + selectedTiles.textContent=selectedNum.textContent; + if(checkCorrect(selectedTiles)){ + + selectedTiles.classList.remove("selected"); + + selectedNum.classList.remove("selected"); + selectedTiles=null; + selectedNum=null; + if(checkDone()){ + endGame(); + } + + }else{ + disableSelect=true; + selectedTiles.classList.add("incorrect"); + setTimeout(function(){ + disableSelect=false; + selectedTiles.classList.remove("incorrect"); + selectedTiles.classList.remove("selected"); + selectedTiles.classList.remove("selected"); + selectedTiles.textContent=""; + selectedTiles=null; + selectedNum=null; + + },1000); + + + } + + } +} +function checkDone(){ + let tile=qsa(".tile"); + for(let i=0;i + + + + + + Sodoku + + + + + +
+

SUDOKU

+
+
+

Choose difficulty:

+ + + +
+
+

Choose time:

+ + + +
+
+

Choose theme:

+ + +
+
+ +
+
+

+

+
+
+
+ + +
+ + diff --git a/Games/Game_01/assets/styles.css b/Games/Game_01/assets/styles.css new file mode 100644 index 00000000..e40130d9 --- /dev/null +++ b/Games/Game_01/assets/styles.css @@ -0,0 +1,107 @@ +.hidden { + display: none; +} +body.dark { + background-color: rgb(45, 100, 117); + color: white; +} +.header { + text-align: center; + padding-bottom: 20px; + padding-top: 10px; + border-bottom: 1px solid green; +} +#A { + font-size: 40px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, + Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; +} +#B { + font-size: 27px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, + Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; +} + +#label { + font-size: 23px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, + Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; +} +#start { + background: #ecf4ff; + + border-radius: 50em; + color: green; + margin-top: 2em; + top: 30em; + width: 17%; + height: 3em; + text-align: center; + z-index: 6; +} +#setup-game { + display: flex; + justify-content: center; +} +#setup-game > * { + margin-bottom: 7px; + padding-left: 20px; + padding-right: 20px; +} +p#timer { + font-size: 25px; + font-weight: bold; + text-align: center; +} +p#lives { + font-size: 25px; + font-weight: bold; + text-align: center; +} +#game { + display: flex; + justify-content: center; +} +#number-container > p { + border: 1px solid black; + border-radius: 20%; + width: 60px; + height: 60px; + font-size: 40pt; + margin-left: 1200px; + margin-top: 5px; + margin-bottom: 5px; +} +#board { + padding-top: 10px; + margin-top: 10px; + display: flex; + flex-wrap: wrap; + justify-content: center; + align-content: flex-start; + margin: 0 315px 500px; + width: 600px; + height: 100px; + float: left; +} +.tile { + border: 1px solid black; + width: 60px; + height: 60px; + text-align: center; + margin: 0px; + vertical-align: middle; + font-size: 40pt; +} +p.selected { + background-color: lightblue; +} +p.incorrect { + color: red; +} +.rightborder { + border-right: 4px solid black; +} +.bottomborder { + border-bottom: 4px solid black; +}