+

+
+
+
+
\ No newline at end of file
diff --git a/RishabhSinghal021/tic-tac-toe/tic.js b/RishabhSinghal021/tic-tac-toe/tic.js
new file mode 100644
index 0000000..df8620e
--- /dev/null
+++ b/RishabhSinghal021/tic-tac-toe/tic.js
@@ -0,0 +1,103 @@
+document.getElementById("player").innerHTML = localStorage.getItem('name')+" Score(X)";
+var CellCheck=0;
+var score = localStorage.getItem('score');
+console.log(score);
+document.getElementById("player1score").innerHTML = score;
+function clickevent(id){
+ //console.log(id);
+ if(document.getElementById(id).innerHTML){
+ alert("Please Don't Cheat");
+ }
+ else
+ {
+ if(CellCheck==0){
+ document.getElementById(id).innerHTML="X";
+ document.getElementById(id).style.backgroundColor = "#ff6a00";
+ Match();
+ CellCheck=1;
+ }
+
+ else{
+ document.getElementById(id).innerHTML="O";
+ document.getElementById(id).style.backgroundColor = "#76b852";
+ Match();
+ CellCheck=0;
+ }
+ }
+}
+function Match(){
+ var one = document.getElementById("1").innerHTML;
+ var two = document.getElementById("2").innerHTML;
+ var three = document.getElementById("3").innerHTML;
+ var four = document.getElementById("4").innerHTML;
+ var five = document.getElementById("5").innerHTML;
+ var six = document.getElementById("6").innerHTML;
+ var seven = document.getElementById("7").innerHTML;
+ var eight = document.getElementById("8").innerHTML;
+ var nine = document.getElementById("9").innerHTML;
+
+ if ((one == two && two == three && three== "X")||
+ (four == five && five == six && six== "X")||
+ (seven == eight && eight == nine && nine== "X")||
+ (one == four && four == seven && seven== "X")||
+ (five == two && two == eight && eight== "X")||
+ (three == six && six == nine && nine== "X")||
+ (nine == five && five == one && one== "X")||
+ (seven == five && five == three && three== "X")){
+ var score = localStorage.getItem('score');
+ score = parseInt(score)+10;
+ localStorage.setItem('score', score);
+ alert("X Player won");
+ updateScore();
+ }
+ else if((one == two && two == three && three== "O")||
+ (four == five && five == six && six== "O")||
+ (seven == eight && eight == nine && nine== "O")||
+ (one == four && four == seven && seven== "O")||
+ (five == two && two == eight && eight== "O")||
+ (three == six && six == nine && nine== "O")||
+ (nine == five && five == one && one== "O")||
+ (seven == five && five == three && three== "O")){
+ var score = localStorage.getItem('score');
+ score = parseInt(score)-5;
+ localStorage.setItem('score', score);
+ alert("O Player won");
+ updateScore();
+ }
+ else if(ChanceCount == 9){
+ alert("tie");
+ window.location="tictactoe.html";
+ }
+}
+
+function updateScore(){
+ var id = localStorage.getItem('id');
+ var pass = localStorage.getItem('pass');
+ var score = localStorage.getItem('score');
+ var name = localStorage.getItem('name');
+ //score = parseInt(score)+10;
+ console.log(score);
+ //localStorage.setItem('score', score);
+ var dataforTicTac={
+ "ID": id,
+ "Name": name,
+ "Password": pass,
+ "Score": score
+ };
+
+ $.ajax({
+ url: 'http://localhost:56869/api/EmployeeDetails/'+id,
+ data: dataforTicTac,
+ type: 'PUT',
+ dataType: 'json',
+ success: function(response){
+ window.location="tictactoe.html"
+ }
+ });
+}
+
+
+
+
+
+
diff --git a/RishabhSinghal021/tic-tac-toe/tictac.css b/RishabhSinghal021/tic-tac-toe/tictac.css
new file mode 100644
index 0000000..a1d37c4
--- /dev/null
+++ b/RishabhSinghal021/tic-tac-toe/tictac.css
@@ -0,0 +1,39 @@
+ td{
+ border-radius: 12px;
+ background-color: gray;
+ width: 100px;
+ height: 100px;
+ color: white;
+ box-sizing: border-box;
+ text-align: center;
+ min-width: 65px;
+ font-weight: bolder;
+ box-shadow: 1px 5px #5E7684;
+ font-size: 20px;
+ cursor: pointer;
+ }
+td:active {
+ color: white;
+ border: 2px solid red;
+}
+.tictacbox {
+ padding: 5px;
+ margin-top: 40px;
+ border-radius: 40px 40px 40px 40px;
+ box-shadow: 3px #757F9A;
+ }
+.score{padding: 10px; width: 50px;height: 20px;border-radius: 8px; margin:20px;background: #C6FFDD;}
+#player{
+ margin: 10px;
+ padding: 10px;
+ text-align: center;
+ font-size: 130%;
+ margin-bottom: 20px;
+ Color: #fd1d1d;
+}
+.tic{margin-top: 20px;}
+body{background: #D3CCE3; /* fallback for old browsers */
+background: -webkit-linear-gradient(to right, #E9E4F0, #D3CCE3); /* Chrome 10-25, Safari 5.1-6 */
+background: linear-gradient(to right, #E9E4F0, #D3CCE3); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
+}
+h1{color: #800000;}
\ No newline at end of file
diff --git a/RishabhSinghal021/tic-tac-toe/tictactoe.html b/RishabhSinghal021/tic-tac-toe/tictactoe.html
new file mode 100644
index 0000000..42c6b20
--- /dev/null
+++ b/RishabhSinghal021/tic-tac-toe/tictactoe.html
@@ -0,0 +1,44 @@
+
+
+
+