{"id":569615,"student_id":26492,"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 {\\r\\n text-align: center;\\r\\n}\\r\\n\\r\\nh1 {\\r\\n color: #dc685a;\\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 border: 3px solid blue;\\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 line-height: 100px;\\r\\n /*使指標碰到格子時,變換樣式*/\\r\\n\\r\\n \\r\\n}\\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: #ecaf4f ;\\r\\n}\\r\\n\\r\\n.red {\\r\\n background-color: #dc685a ;\\r\\n}\\r\\n\",\"js\":\"var current = \\\"O\\\";\\n$(\\\".grid div\\\").click(place);\\n\\nfunction place(){\\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\\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 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\\nfunction check(x, y, z){\\n if(x == y \u0026\u0026 y == z \u0026\u0026 x !=\\\"\\\"){\\n $('h1').text(x + '獲勝');\\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 });\\n \\n \\n \\n \\n \\n \\n \\n \"}","created_at":"2023-07-18T19:07:36.612+08:00","updated_at":"2023-07-18T21:26:05.228+08:00","name":"井字遊戲(S) 副本","language":"web","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/569615/3f22d7b576db45e87b88dcfd9e102c0c.jpg"},"parent_id":76659,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":13,"hashid":"npmsz2yg9","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
到這台電腦