{"id":311646,"student_id":3770,"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\u003eTic Tac Toe\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 {\\n text-align: center;\\n}\\n\\nh1 {\\n color: #dc685a;\\n}\\n\\nbutton {\\n padding: 10px;\\n border-width: 0px;\\n border-radius: 5px;\\n margin: 15px;\\n font-size: 16px;\\n color: #fff;\\n background-color: #ecaf4f;\\n}\\n\\n/* 設定格子大小,並使他置中 */\\n.grid {\\n width: 330px;\\n height: 330px;\\n margin: auto;\\n border: 3px solid blue;\\n}\\n\\n.grid div {\\n font-size: 60px;\\n font-weight: bold;\\n color: #ffffff;\\n text-shadow: 0px 0px 10px #999;\\n box-shadow: 0px 0px 10px #999;\\n border-radius: 10px;\\n\\n /*將div設為正方形大小*/\\n width: 100px;\\n height: 100px;\\n margin: 5px;\\n\\n\\n /*透過浮動,使div不會直接換行*/\\n float: left;\\n /*設定行高跟正方形一樣高,使字的可以在格子上下位置的中間*/\\n line-height: 100px;\\n /*使指標碰到格子時,變換樣式*/\\n transition : background-color 0.5s;\\n cursor: pointer;\\n\\n}\\n\\n\\n\\n.gray {\\n background-color: #555555;\\n\\n}\\n.gray:hover {\\n background-color: #333333;\\n}\\n\\n.orange {\\n background-color: #ecaf4f;\\n}\\n\\n.red {\\n background-color: #dc685a;\\n}\",\"js\":\"var current = (\\\"O\\\");\\nvar playing = true;\\n$ (\\\".grid div\\\").click(place);\\n\\nfunction place() {\\n\\n if ($(this).text() == '' \u0026\u0026 playing == true) {\\n $(this).text(current);\\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 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 check(a, b, c);\\n check(d, e, f);\\n check(g, h, i);\\n\\n check(a, d, g);\\n check(d, e, h);\\n check(c, f, i);\\n\\n check(a, e, i);\\n check(c, e, g);\\n}\\n\\nfunction check(x, y, z) {\\n if (x == y \u0026\u0026 y == z \u0026\u0026 x != \\\"\\\") {\\n $('h1').text(x + '獲勝');\\n playing = false;\\n }\\n}\\n\\n$('button').click(function() {\\n $('h1').text('Tic tac toe');\\n $ (\\\".grid div\\\").text('');\\n\\n $ (\\\".grid div\\\").removeClass('red');\\n $ (\\\".grid div\\\").removeClass('orange');\\n $ (\\\".grid div\\\").addClass('gray');\\n \\n playing = true;\\n});\"}","created_at":"2021-11-06T13:38:49.247+08:00","updated_at":"2021-11-06T14:27:19.603+08:00","name":"井字遊戲(S) 副本","language":"web","screenshot":{"url":null},"parent_id":76659,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":29,"hashid":"meyswe28q","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
到這台電腦