{"id":32010,"student_id":1587,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003e井字遊戲\u003c/title\u003e\\n \u003clink rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css\\\"\u003e\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.2.1.slim.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003ch1 class=\\\"p-3 text-center js-winner\\\"\u003e開始比賽\u003c/h1\u003e\\n \u003cdiv class=\\\"grid\\\"\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"a\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"b\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"c\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"d\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"e\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"f\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"g\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"h\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"cell\\\" id=\\\"i\\\"\u003e\u003c/div\u003e\\n \u003c/div\u003e\\n \u003cdiv class=\\\"text-center mt-3\\\"\u003e\\n \u003cbutton class=\\\"btn btn-primary js-reset\\\"\u003e重新開始\u003c/button\u003e\\n \u003c/div\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"body {\\n background-color: #94e580;\\n}\\n.grid {\\n width: 300px;\\n height: 300px;\\n display: flex;\\n flex-wrap: wrap;\\n margin: auto;\\n}\\n.cell {\\n border: 1px solid #ccc;\\n width: 100px;\\n height: 100px;\\n line-height: 100px;\\n text-align: center;\\n font-size: 3rem;\\n font-weight: 900;\\n}\",\"js\":\"var current = 0;\\nvar text = $(this).text();\\n\\nvar a = $(\\\"#a\\\").text();\\nvar b = $(\\\"#b\\\").text();\\nvar c = $(\\\"#c\\\").text();\\nvar d = $(\\\"#d\\\").text();\\nvar e = $(\\\"#e\\\").text();\\nvar f = $(\\\"#f\\\").text();\\nvar g = $(\\\"#g\\\").text();\\nvar h = $(\\\"#h\\\").text();\\nvar i = $(\\\"#i\\\").text();\\n\\nvar winner = 0;\\n// $('.cell').click(checker);\\n$('.cell').click(function() {\\n if (current == 0 \u0026\u0026 $(this).text() == \\\"\\\") {\\n $(this).addClass(\\\"bg-primary\\\");\\n $(this).text(\\\"X\\\");\\n current = 1;\\n } else if (current == 1 \u0026\u0026 $(this).text() == \\\"\\\") {\\n $(this).addClass(\\\"bg-warning\\\");\\n $(this).text(\\\"O\\\");\\n current = 0;\\n }\\n text = $(this).text();\\n /*\\n a = $(\\\"#a\\\").text();\\n b = $(\\\"#b\\\").text();\\n c = $(\\\"#c\\\").text();\\n d = $(\\\"#d\\\").text();\\n e = $(\\\"#e\\\").text();\\n f = $(\\\"#f\\\").text();\\n g = $(\\\"#g\\\").text();\\n h = $(\\\"#h\\\").text();\\n i = $(\\\"#*i\\\").text();\\n */\\n $(\\\".cell\\\").click(checker(\\\"a\\\", \\\"b\\\", \\\"c\\\"));\\n $(\\\".cell\\\").click(checker(\\\"d\\\", \\\"e\\\", \\\"f\\\"));\\n $(\\\".cell\\\").click(checker(\\\"g\\\", \\\"h\\\", \\\"i\\\"));\\n $(\\\".cell\\\").click(checker(\\\"a\\\", \\\"d\\\", \\\"g\\\"));\\n $(\\\".cell\\\").click(checker(\\\"b\\\", \\\"e\\\", \\\"h\\\"));\\n $(\\\".cell\\\").click(checker(\\\"c\\\", \\\"f\\\", \\\"i\\\"));\\n $(\\\".cell\\\").click(checker(\\\"a\\\", \\\"e\\\", \\\"i\\\"));\\n $(\\\".cell\\\").click(checker(\\\"c\\\", \\\"e\\\", \\\"g\\\"));\\n\\n\\n function checker (x, y, z) {\\n x1 = $(\\\"#\\\"+x).text();\\n y1 = $(\\\"#\\\"+y).text();\\n z1 = $(\\\"#\\\"+z).text();\\n if (x1 == y1 \u0026\u0026 y1 == z1 \u0026\u0026 x1 != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = x1;\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n }\\n\\n // 以下為我的原始程式碼--------(T。T) 哇嗚~~~~~我辛苦了好久/*x*\\\\哭哭:(\\n /*\\n if (a == b \u0026\u0026 b == c \u0026\u0026 a != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#a').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n if (d == e \u0026\u0026 e == f \u0026\u0026 d != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#d').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n if (g == h \u0026\u0026 h == i \u0026\u0026 g != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#g').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n if (a == d \u0026\u0026 d == g \u0026\u0026 a != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#a').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n if (b == e \u0026\u0026 e == h \u0026\u0026 b != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#b').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n no = 1;\\n stop();\\n }\\n if (c == f \u0026\u0026 f == i \u0026\u0026 c != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#c').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n if (a == e \u0026\u0026 e == i \u0026\u0026 a != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#a').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n if (c == e \u0026\u0026 e == g \u0026\u0026 c != \\\"\\\" \u0026\u0026 winner == 0) {\\n winner = \\\"\\\";\\n winner = $('#c').text();\\n $('.js-winner').text(winner + \\\"勝利\\\");\\n stop();\\n }\\n */\\n});\\n\\n$(\\\".btn\\\").click(function() {\\n $('.cell').removeClass('bg-primary');\\n $('.cell').removeClass('bg-warning');\\n $('.js-winner').text(\\\"開始比賽\\\");\\n $('.cell').text(\\\"\\\");\\n winner = 0;\\n});\\nconsole.log(\\\"-------\\\");\\nconsole.log(\\\"S*E*C*R*E*T____I_M_F_O_R_M_A_T_I_O_N\\\");\\nconsole.log(\\\"Mr. Enoch is absolutely smart and cool that he is such amazing!!!\\\");\\nconsole.log(\\\"This was said by the computer, not any person.\\\");\\nconsole.log(\\\"-------\\\");\\n\"}","created_at":"2018-06-23T12:15:10.169+08:00","updated_at":"2019-11-10T18:05:23.191+08:00","name":"井字遊戲","language":"web","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/32010/d95b7255b09ced66fbca443c2adc4068.jpg"},"parent_id":21936,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":140,"hashid":"9ygs59ed","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
繁中
简中
English
日本語
1:1:1
1:1
全寬
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦