diff --git a/TicTacToe game/index.html b/TicTacToe game/index.html new file mode 100644 index 000000000..156e2e6c4 --- /dev/null +++ b/TicTacToe game/index.html @@ -0,0 +1,34 @@ + + + + + + + TicTacToe + + + + + +
+
+

Tic Tac Toe

+
+ +
+ +
+ + \ No newline at end of file diff --git a/TicTacToe game/script.js b/TicTacToe game/script.js new file mode 100644 index 000000000..8ccba953b --- /dev/null +++ b/TicTacToe game/script.js @@ -0,0 +1,96 @@ +$(document).ready(function(){ + var x = "x"; + var o = "o"; + var turns = 0; + // Spot vars + var spot1 = $('#spot1'); + var spot2 = $('#spot2'); + var spot3 = $('#spot3'); + var spot4 = $('#spot4'); + var spot5 = $('#spot5'); + var spot6 = $('#spot6'); + var spot7 = $('#spot7'); + var spot8 = $('#spot8'); + var spot9 = $('#spot9'); + + $('#board li').on('click', function(){ + if(spot1.hasClass('o') && spot2.hasClass('o') && spot3.hasClass('o') || + spot4.hasClass('o') && spot5.hasClass('o') && spot6.hasClass('o') || + spot7.hasClass('o') && spot8.hasClass('o') && spot9.hasClass('o') || + spot1.hasClass('o') && spot4.hasClass('o') && spot7.hasClass('o') || + spot2.hasClass('o') && spot5.hasClass('o') && spot8.hasClass('o') || + spot3.hasClass('o') && spot6.hasClass('o') && spot9.hasClass('o') || + spot1.hasClass('o') && spot5.hasClass('o') && spot9.hasClass('o') || + spot3.hasClass('o') && spot5.hasClass('o') && spot7.hasClass('o') + ){ + alert('Winner: O'); + $('#board li').text('+'); + $('#board li').removeClass('disable'); + $('#board li').removeClass('o'); + $('#board li').removeClass('x'); + } else if(spot1.hasClass('x') && spot2.hasClass('x') && spot3.hasClass('x') || + spot4.hasClass('x') && spot5.hasClass('x') && spot6.hasClass('x') || + spot7.hasClass('x') && spot8.hasClass('x') && spot9.hasClass('x') || + spot1.hasClass('x') && spot4.hasClass('x') && spot7.hasClass('x') || + spot2.hasClass('x') && spot5.hasClass('x') && spot8.hasClass('x') || + spot3.hasClass('x') && spot6.hasClass('x') && spot9.hasClass('x') || + spot1.hasClass('x') && spot5.hasClass('x') && spot9.hasClass('x') || + spot3.hasClass('x') && spot5.hasClass('x') && spot7.hasClass('x') + ){ + alert('Winner: X'); + $('#board li').text('+'); + $('#board li').removeClass('disable'); + $('#board li').removeClass('o'); + $('#board li').removeClass('x'); + } else if(turns == 9){ + alert('Tie Game'); + $('#board li').text('+'); + $('#board li').removeClass('disable'); + $('#board li').removeClass('o'); + $('#board li').removeClass('x'); + turns = 0; + } else if($(this).hasClass('disable')){ + alert('This spot is already filled'); + } else if(turns%2 == 0){ + turns++; + $(this).text(o); + $(this).addClass('disable o'); + if(spot1.hasClass('o') && spot2.hasClass('o') && spot3.hasClass('o') || + spot4.hasClass('o') && spot5.hasClass('o') && spot6.hasClass('o') || + spot7.hasClass('o') && spot8.hasClass('o') && spot9.hasClass('o') || + spot1.hasClass('o') && spot4.hasClass('o') && spot7.hasClass('o') || + spot2.hasClass('o') && spot5.hasClass('o') && spot8.hasClass('o') || + spot3.hasClass('o') && spot6.hasClass('o') && spot9.hasClass('o') || + spot1.hasClass('o') && spot5.hasClass('o') && spot9.hasClass('o') || + spot3.hasClass('o') && spot5.hasClass('o') && spot7.hasClass('o') + ){ + alert('Winner: O'); + turns = 0; + } + } else { + turns++; + $(this).text(x); + $(this).addClass('disable x'); + if(spot1.hasClass('x') && spot2.hasClass('x') && spot3.hasClass('x') || + spot4.hasClass('x') && spot5.hasClass('x') && spot6.hasClass('x') || + spot7.hasClass('x') && spot8.hasClass('x') && spot9.hasClass('x') || + spot1.hasClass('x') && spot4.hasClass('x') && spot7.hasClass('x') || + spot2.hasClass('x') && spot5.hasClass('x') && spot8.hasClass('x') || + spot3.hasClass('x') && spot6.hasClass('x') && spot9.hasClass('x') || + spot1.hasClass('x') && spot5.hasClass('x') && spot9.hasClass('x') || + spot3.hasClass('x') && spot5.hasClass('x') && spot7.hasClass('x') + ){ + alert('Winner: X'); + turns = 0; + } + } + }); + // Reset Handler + $("#reset").click(function(){ + $("#board li").text("+"); + $("#board li").removeClass('disable'); + $("#board li").removeClass('o'); + $("#board li").removeClass('x'); + turns = 0; + }); +}); \ No newline at end of file diff --git a/TicTacToe game/style.css b/TicTacToe game/style.css new file mode 100644 index 000000000..6b3877d99 --- /dev/null +++ b/TicTacToe game/style.css @@ -0,0 +1,64 @@ +body { + background-color:#1c1b1b; + color: #666; + font-family: Verdana, Geneva, Tahoma, sans-serif; +} + +h1{ + text-align: center; + color: azure; +} + +.clearfix{ + clear:both; +} + +#container{ + width:350px; + overflow:auto; + margin: 40px auto; + background: #666; + padding-bottom: 40px; + border-radius:10px; +} + +#board li{ + float: left; + margin:10px; + height: 70px; + width: 70px; + font-size: 55px; + background: #333; + color: #ccc; + list-style: none; + text-align:center; + border-radius: 5px; +} + +#board li:hover,#reset:hover { + cursor: pointer; + background-color: black; +} + +#reset{ + border:0; + background-color: #444; + color: #fff; + width: 70%; + padding: 15px; + border-radius:5px; +} + +.o{ + color: green !important ; +} + +.x{ + color: red !important; +} + +footer{ + display: block; + text-align: center; + padding-top: 20px; +} diff --git a/bmi app/android/.gradle/7.4.2/checksums/checksums.lock b/bmi app/android/.gradle/7.4.2/checksums/checksums.lock new file mode 100644 index 000000000..d0e0602ef Binary files /dev/null and b/bmi app/android/.gradle/7.4.2/checksums/checksums.lock differ diff --git a/bmi app/android/.gradle/7.4.2/fileChanges/last-build.bin b/bmi app/android/.gradle/7.4.2/fileChanges/last-build.bin new file mode 100644 index 000000000..f76dd238a Binary files /dev/null and b/bmi app/android/.gradle/7.4.2/fileChanges/last-build.bin differ diff --git a/bmi app/android/.gradle/7.4.2/fileHashes/fileHashes.lock b/bmi app/android/.gradle/7.4.2/fileHashes/fileHashes.lock new file mode 100644 index 000000000..fb0304fe0 Binary files /dev/null and b/bmi app/android/.gradle/7.4.2/fileHashes/fileHashes.lock differ diff --git a/bmi app/android/.gradle/7.4.2/gc.properties b/bmi app/android/.gradle/7.4.2/gc.properties new file mode 100644 index 000000000..e69de29bb diff --git a/bmi app/android/.gradle/vcs-1/gc.properties b/bmi app/android/.gradle/vcs-1/gc.properties new file mode 100644 index 000000000..e69de29bb