{"id":230846,"student_id":12205,"content":"{\"html\":\"\u003chtml\u003e\\r\\n\u003chead\u003e\\r\\n\\t\u003ctitle\u003e井字遊戲\u003c/title\u003e\\r\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.2.1.min.js\\\"\u003e\u003c/script\u003e\\r\\n\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n \u003ch1\u003e井字遊戲\u003c/h1\u003e\\r\\n \u003cdiv class=\\\"grid\\\"\u003e\\r\\n \u003cdiv id=\\\"a\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"b\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"c\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"d\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"e\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"f\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"g\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"h\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003cdiv id=\\\"i\\\" class=\\\"gray\\\"\u003e\u003c/div\u003e\\r\\n \u003c/div\u003e\\r\\n \u003cbutton\u003e再來一局!\u003c/button\u003e\\r\\n\u003c/body\u003e\\r\\n\u003c/html\u003e\\r\\n\",\"css\":\"body {\\r\\n text-align: center;\\r\\n}\\r\\n\\r\\nh1 {\\r\\n color: /*#dc685a*/ #33FFDD\\t;\\r\\n}\\r\\n\\r\\nbutton {\\r\\n padding: 10px;\\r\\n border-width: 0px;\\r\\n border-radius: 5px;\\r\\n margin: 15px;\\r\\n font-size: 16px;\\r\\n color: #fff;\\r\\n background-color: #ecaf4f;\\r\\n}\\r\\n\\r\\n/* 設定格子大小,並使他置中 */\\r\\n.grid {\\r\\n width: 330px;\\r\\n height: 330px;\\r\\n margin: auto;\\r\\n}\\r\\n\\r\\n.grid div {\\r\\n font-size: 60px;\\r\\n font-weight: bold;\\r\\n color: #ffffff;\\r\\n text-shadow: 0px 0px 10px #999;\\r\\n box-shadow: 0px 0px 10px #999;\\r\\n border-radius: 10px;\\r\\n \\r\\n /*將div設為正方形大小*/\\r\\n width: 100px;\\r\\n height: 100px;\\r\\n margin: 5px;\\r\\n\\r\\n \\r\\n /*透過浮動,使div不會直接換行*/\\r\\n float: left;\\r\\n\\r\\n /*設定行高跟正方形一樣高,使字的可以在格子上下位置的中間*/\\r\\n line-height: 100px;\\r\\n\\r\\n /*使指標碰到格子時,變換樣式*/\\r\\n\\r\\n \\r\\n}\\r\\n \\r\\nh1{\\r\\n background-color: #555555;\\r\\n\\r\\n}\\r\\n\\r\\n.gray{\\r\\n background-color: #555555;\\r\\n\\r\\n}\\r\\n.gray:hover {\\r\\n background-color: #333333;\\r\\n}\\r\\n\\r\\n.orange {\\r\\n background-color: #003377 ;\\r\\n}\\r\\n\\r\\n.red {\\r\\n background-color: #008800 ;\\r\\n}\\r\\n\",\"js\":\"$(\\\".grid div\\\").click(place);\\n$(\\\"button\\\").click(again);\\nvar current = \\\"O\\\";\\nvar abc = \\\"\\\";\\nfunction place() {\\n if ($(this).text() == \\\"\\\" \u0026\u0026 abc != \\\"win\\\") {\\n $(this).text(current);\\n var a = $(\\\"#a\\\").text();\\n var b = $(\\\"#b\\\").text();\\n var c = $(\\\"#c\\\").text();\\n var d = $(\\\"#d\\\").text();\\n var e = $(\\\"#e\\\").text();\\n var f = $(\\\"#f\\\").text();\\n var g = $(\\\"#g\\\").text();\\n var h = $(\\\"#h\\\").text();\\n var i = $(\\\"#i\\\").text();\\n\\n\\n if (current == \\\"O\\\") {\\n current = \\\"X\\\";\\n $(this).removeClass(\\\"gray\\\");\\n $(this).addClass(\\\"orange\\\");\\n } else {\\n current = \\\"O\\\";\\n $(this).removeClass(\\\"gray\\\");\\n $(this).addClass(\\\"red\\\");\\n\\n }\\n\\n\\n\\n check(a, b, c);\\n check(d, e, f);\\n check(g, h, i);\\n check(a, d, g);\\n check(b, e, h);\\n check(c, f, i);\\n check(a, e, i);\\n check(c, e, g);\\n\\n }\\n}\\n\\n\\nfunction again() {\\n /*$(\\\"h1\\\").text(\\\"Tic Tac Toe\\\");\\n $(\\\".grid div\\\").text(\\\"\\\");\\n $(\\\".grid div\\\").removeClass(\\\"orange\\\");\\n $(\\\".grid div\\\").removeClass(\\\"red\\\");\\n $(\\\".grid div\\\").addClass(\\\"gray\\\");*/\\n $(\\\"h1\\\").text(\\\"Tic Tac Toe\\\");\\n $(\\\".grid div\\\").text(\\\"\\\");\\n $(\\\".grid div\\\").removeClass(\\\"orange\\\");\\n $(\\\".grid div\\\").removeClass(\\\"red\\\");\\n $(\\\".grid div\\\").addClass(\\\"gray\\\");\\n $(\\\".grid div\\\").click(place);\\n$(\\\"button\\\").click(again);\\nvar current = \\\"O\\\";\\nvar abc = \\\"\\\";\\n}\\n\\nfunction check(x, y, z) {\\n if (x == y \u0026\u0026 y == z \u0026\u0026 x != \\\"\\\") {\\n abc = \\\"win\\\";\\n $(\\\"h1\\\").text(x + \\\"獲勝\\\");\\n }\\n}\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n/*$(\\\".grid div\\\").click(place);\\n$(\\\".button\\\").click(again);\\nvar current = 'o';\\nfunction place() {\\n\\n if (current == 'o') {\\n current = 'X';\\n $(this).text('○');\\n $(this).removeClass('gray')\\n $(this).addClass('orange')\\n\\n } else {\\n current = 'o';\\n $(this).text('X');\\n $(this).removeClass('gray')\\n $(this).addClass('red')\\n }\\n var a = $('#a').text();\\n var b = $('#b').text();\\n var c = $('#c').text();\\n var d = $('#d').text();\\n var e = $('#e').text();\\n var f = $('#f').text();\\n var g = $('#g').text();\\n var h = $('#h').text();\\n var i = $('#i').text();\\n check(a, b, c);\\n check(d, e, f);\\n check(g, h, i);\\n\\n check(a, d, g);\\n check(b, e, h);\\n check(c, f, i);\\n\\n check(a, e, i);\\n check(c, e, g);\\n\\n\\n function check(x , y, z) {\\n if (x == y \u0026\u0026 y == z \u0026\u0026 x != '') {\\n $('h1').text(z + '勝利');\\n\\n function again() {\\n $(\\\"h1\\\").text(\\\"Tic Tac Toe\\\");\\n $(\\\".grid div\\\").text(\\\"\\\");\\n $(\\\".grid div\\\").removeClass(\\\"orange\\\");\\n $(\\\".grid div\\\").removeClass(\\\"red\\\");\\n $(\\\".grid div\\\").addClass(\\\"gray\\\");\\n }\\n\\n }\\n }\\n}*/\"}","created_at":"2021-02-24T19:04:43.459+08:00","updated_at":"2021-02-26T19:18:31.921+08:00","name":"井字遊戲(S) 副本","language":"web","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/230846/5f28b119bc8e69431cf9caa96809c5ee.jpg"},"parent_id":76659,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":46,"hashid":"meysw93y8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦