{"id":90352,"student_id":10,"content":"var randColor;\nvar diffColor;\nvar randX;\nvar randY;\nvar level = 0;\nvar cellWidth = 0;\nvar size = 3;\n\nfunction startLevel () {\n\n if (level == 0) size = 3;\n if (level == 1) size = 4;\n if (level == 2) size = 5;\n if (level \u003e= 3) size = 6;\n if (level \u003e= 5) size = 7;\n if (level \u003e= 7) size = 8;\n\n var diff = 10;\n if (level \u003e= 5) diff = 9;\n if (level \u003e= 10) diff = 8;\n if (level \u003e= 15) diff = 7;\n if (level \u003e= 20) diff = 6;\n if (level \u003e= 25) diff = 5;\n if (level \u003e= 30) diff = 4;\n\n\n var h = Math.random()*360;\n var s = Math.random()*70 + 15;\n var l = Math.random()*70 + 15;\n\n\n randColor = 'hsl(' + h + ',' + s + '%,'+ l + '%)';\n diffColor = 'hsl(' + h + ',' + s + '%,'+ (l + diff) + '%)';\n\n randX = Math.floor(Math.random()*size);\n randY = Math.floor(Math.random()*size);\n}\n\nforever(function(){\n\n print('level:' + level);\n\n cellWidth = 440/size - 5;\n\n for(var x=0; x\u003csize; x++) {\n for(var y=0; y\u003csize; y++) {\n drawCell(x, y, cellWidth, randColor);\n }\n }\n drawCell(randX, randY, cellWidth, diffColor);\n});\n\nfunction drawCell (x, y, w, color) {\n pen.size = 0;\n pen.fillColor = color;\n pen.drawRect(x*(w+5) + 100, y*(w+5) + 25, w, w);\n}\n\nwhen('click', function () {\n var x = randX*(cellWidth+5)+100;\n var y = randY*(cellWidth+5)+25;\n if (x \u003c cursor.x \u0026\u0026 cursor.x \u003c x + cellWidth \u0026\u0026 y \u003c cursor.y \u0026\u0026 cursor.y \u003c y + cellWidth) {\n level++;\n startLevel();\n }\n});\n\nsetTimeout(function () {\n var animal = ['蝙蝠','鼴鼠','狗','狗','貓','貓','老虎','老虎','鷹'][Math.floor(level/5)];\n alert('時間到! 顏色敏銳等級為:lv' + level + '\\n您擁有了' + animal + '的眼睛');\n stop();\n}, 40000);\n\nstartLevel();","created_at":"2019-08-23T12:09:35.369+08:00","updated_at":"2021-11-15T15:24:33.361+08:00","name":"眼睛敏銳大考驗!!!","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/90352/f3b915f59eb86983cd59592bfdcf8cc2.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":282,"hashid":"6rpsygpz","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
到這台電腦