{"id":104566,"student_id":2002,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\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 class=\\\"p-5\\\"\u003e\\n \u003ch1 class=\\\"text-center\\\"\u003e1A2B 猜數字\u003c/h1\u003e\\n \u003cinput id=\\\"input\\\" type=\\\"text\\\" style=\\\"width: 100%;\\\"\u003e\\n \u003cbutton id=\\\"submit\\\" class=\\\"my-3 btn btn-primary btn-block\\\"\u003e送出\u003c/button\u003e\\n \u003cbutton id=\\\"reset\\\" class=\\\"my-3 btn btn-primary btn-block\\\"\u003e重新開始\u003c/button\u003e\\n \u003ctable class=\\\"table table-striped\\\"\u003e\\n \u003cthead\u003e\\n \u003ctr\u003e\\n \u003cth\u003e#\u003c/th\u003e\\n \u003cth\u003e猜\u003c/th\u003e\\n \u003cth\u003e結果\u003c/th\u003e\\n \u003c/tr\u003e\\n \u003c/thead\u003e\\n \u003ctbody\u003e\\n \u003c/tbody\u003e\\n \u003c/table\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"\",\"js\":\"var num = [\\\"0\\\", \\\"1\\\", \\\"2\\\", \\\"3\\\", \\\"4\\\", \\\"5\\\", \\\"6\\\", \\\"7\\\", \\\"8\\\", \\\"9\\\"];\\nvar ans = [];\\nvar a = 0;\\nvar b = 0;\\nvar count = 0;\\nfor (var i = 0; i \u003c 4; i++) {\\n var ran = Math.floor(Math.random() * num.length);\\n ans.push(num[ran]);\\n num.splice(ran, 1);\\n}\\n\\n$(\\\"#submit\\\").on(\\\"click\\\", function() {\\n var guess = $(\\\"#input\\\").val();\\n $(\\\"#input\\\").val(\\\"\\\");\\n count += 1;\\n for (var i = 0; i \u003c guess.length; i++) {\\n var index = ans.indexOf(guess[i]);\\n if (index != -1) {\\n if (index === i) {\\n a = 1;\\n } else {\\n b = 1;\\n }\\n }\\n }\\n var row = ` \u003ctr\u003e\\n \u003ctd\u003e${count}\u003c/td\u003e\\n \u003ctd\u003e${guess}\u003c/td\u003e\\n \u003ctd\u003eA:${a} B:${b}\u003c/td\u003e\\n \u003c/tr\u003e`;\\n $(\\\"tbody\\\").append(row);\\n if (a === 4) {\\n alert(\\\"獲勝!!!\\\");\\n }\\n});\\n$(\\\"#reset\\\").on(\\\"click\\\", function() {\\n $(\\\"tbody\\\").empty();\\n var a = 0;\\n var b = 0;\\n var count = 0;\\n for (var i = 0; i \u003c 4; i++) {\\n var ran = Math.floor(Math.random() * num.length);\\n ans.push(num[ran]);\\n num.splice(ran, 1);\\n }\\n $(\\\"#submit\\\").on(\\\"click\\\", function() {\\n var guess = $(\\\"#input\\\").val();\\n $(\\\"#input\\\").val(\\\"\\\");\\n count += 1;\\n for (var i = 0; i \u003c guess.length; i++) {\\n var index = ans.indexOf(guess[i]);\\n if (index != -1) {\\n if (index === i) {\\n a += 1;\\n } else {\\n b += 1;\\n }\\n }\\n }\\n });\\n});\"}","created_at":"2019-11-02T16:14:02.199+08:00","updated_at":"2019-11-09T18:10:36.351+08:00","name":"1A2B 猜數字 副本","language":"web","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/104566/e9e6f62b14a243060f82c75b16d8f2ae.jpg"},"parent_id":26634,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":45,"hashid":"9ygs8dng","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
到這台電腦