{"id":12423,"student_id":10,"content":"setBackdrop(\"#222\");\nvar grid = [];\nvar padding = 20;\npen.size = 0;\n\nforever(function(){\n\n var w,h;\n\n w = grid.length;\n h = 1;\n for(var i=0; i\u003cgrid.length; i++) {\n if(grid[i].constructor === Array \u0026\u0026 grid[i].length \u003e h) {\n h = grid[i].length;\n }\n }\n\n var a = (640 - padding*2) / w;\n var b = (480 - padding*2) / h;\n var cellWidth = a \u003e b ? b : a;\n\n var offsetX = (640 - cellWidth * w) / 2;\n var offsetY = (480 - cellWidth * h) / 2;\n\n var time = Date.now()/1000;\n\n for(var i=0; i\u003cgrid.length; i++) {\n console.log('w')\n if(grid[i].constructor === Array) {\n for(var j=0; j\u003cgrid[i].length; j++) {\n if(grid[i][j]===undefined) continue;\n pen.fillColor = grid[i][j];\n if(window.shape == 'rect' \u0026\u0026 !animate) {\n pen.drawRect(offsetX + i*cellWidth, offsetY + j*cellWidth, cellWidth - cellWidth/10, cellWidth - cellWidth/10);\n }\n if(window.shape == 'circle' \u0026\u0026 !animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2, offsetY + j*cellWidth + cellWidth/2, cellWidth/2 - cellWidth/10);\n }\n if(animate) {\n var waveX = Math.sin(time*3.5 - Math.PI*i/8);\n var waveY = Math.sin(time*3.5 - Math.PI*i/8 - Math.PI/2);\n }\n if(window.shape == 'rect' \u0026\u0026 animate) {\n pen.drawRect(offsetX + i*cellWidth + waveX*3, offsetY + j*cellWidth + waveY*6, cellWidth - cellWidth/10 - waveX*1.2, cellWidth - cellWidth/10 - waveX*1.2);\n }\n if(window.shape == 'circle' \u0026\u0026 animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2 + waveX*3, offsetY + j*cellWidth + cellWidth/2 + waveY*6, cellWidth/2 - cellWidth/10 - waveX*1.2);\n }\n }\n } else {\n if(grid[i]===undefined) continue;\n pen.fillColor = grid[i];\n if(window.shape == 'rect' \u0026\u0026 !animate) {\n pen.drawRect(offsetX + i*cellWidth, offsetY, cellWidth - cellWidth/10, cellWidth - cellWidth/10);\n }\n if(window.shape == 'circle' \u0026\u0026 !animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2, offsetY + cellWidth/2, cellWidth/2 - cellWidth/10);\n }\n if(animate) {\n var waveX = Math.sin(time*3.5 - Math.PI*i/8);\n var waveY = Math.sin(time*3.5 - Math.PI*0/8 - Math.PI/2);\n }\n if(window.shape == 'rect' \u0026\u0026 animate) {\n pen.drawRect(offsetX + i*cellWidth + waveX*3, offsetY + waveY*6, cellWidth - cellWidth/10 - waveX*1.2, cellWidth - cellWidth/10 - waveX*1.2);\n }\n if(window.shape == 'circle' \u0026\u0026 animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2 + waveX*3, offsetY + cellWidth/2 + waveY*6, cellWidth/2 - cellWidth/10 - waveX*1.2);\n }\n }\n }\n\n if(index) {\n var size = cellWidth/3 \u003e 30 ? 30 : cellWidth/3;\n console.log(cellWidth/3)\n for(var i=0; i\u003cw; i++) {\n print(i, offsetX + i*cellWidth, offsetY - size*1.5, \"white\", size);\n }\n if(h \u003e 1) {\n for(var i=0; i\u003ch; i++) {\n print(i, offsetX - size*1.5, offsetY + i*cellWidth, \"white\", size);\n }\n }\n }\n});\nvar grid = [];\nvar shape = 'circle'; \nvar index = false;\nvar animate = true;\nvar row = [];\nvar row2 = [];\nvar row3 = [];\nvar row4 = [];\nfunction ddd(){\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row.push(\"blue\");\n }\n for(var i=0; i\u003c40; i+=1) {\n grid.push(row);\n };\n};\nfunction aaa(){\n for(var i=0; i\u003c8; i+=1) {\n row2.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row2.push(\"white\");\n }\n for(var i=0; i\u003c8; i+=1) {\n row2.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row2.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row2.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row2.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row2.push(\"blue\");\n }\n for(var i=0; i\u003c8; i+=1) {\n grid.push(row2);\n };\n}\nfunction sss(){\n for(var i=0; i\u003c8; i+=1) {\n row4.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row4.push(\"white\");\n }\n for(var i=0; i\u003c8; i+=1) {\n row4.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row4.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row4.push(\"blue\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row4.push(\"white\");\n }\n for(var i=0; i\u003c4; i+=1) {\n row4.push(\"blue\");\n }\n for(var i=0; i\u003c8; i+=1) {\n grid.push(row4);\n };\n}\naaa();\nfor(var i=0; i\u003c20; i+=1) {\n row3.push(\"white\");\n}\nfor(var i=0; i\u003c4; i+=1) {\n row3.push(\"white\");\n}\nfor(var i=0; i\u003c4; i+=1) {\n row3.push(\"blue\");\n}\nfor(var i=0; i\u003c4; i+=1) {\n row3.push(\"white\");\n}\nfor(var i=0; i\u003c4; i+=1) {\n row3.push(\"blue\");\n}\nfor(var i=0; i\u003c4; i+=1) {\n grid.push(row3);\n};\nsss();\nddd();","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-11T11:30:20.303+08:00","name":"希臘","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/12423/89edcce60b8890776f43b51e69f48ea4.jpg"},"parent_id":11194,"plugin":"var grid = [];\nvar padding = 20;\npen.size = 0;\n\nforever(function(){\n\n var w,h;\n\n w = grid.length;\n h = 1;\n for(var i=0; i\u003cgrid.length; i++) {\n if(grid[i].constructor === Array \u0026\u0026 grid[i].length \u003e h) {\n h = grid[i].length;\n }\n }\n\n var a = (640 - padding*2) / w;\n var b = (480 - padding*2) / h;\n var cellWidth = a \u003e b ? b : a;\n\n var offsetX = (640 - cellWidth * w) / 2;\n var offsetY = (480 - cellWidth * h) / 2;\n\n var time = Date.now()/1000;\n\n for(var i=0; i\u003cgrid.length; i++) {\n console.log('w')\n if(grid[i].constructor === Array) {\n for(var j=0; j\u003cgrid[i].length; j++) {\n if(grid[i][j]===undefined) continue;\n pen.fillColor = grid[i][j];\n if(window.shape == 'rect' \u0026\u0026 !animate) {\n pen.drawRect(offsetX + i*cellWidth, offsetY + j*cellWidth, cellWidth - cellWidth/10, cellWidth - cellWidth/10);\n }\n if(window.shape == 'circle' \u0026\u0026 !animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2, offsetY + j*cellWidth + cellWidth/2, cellWidth/2 - cellWidth/10);\n }\n if(animate) {\n var waveX = Math.sin(time*3.5 - Math.PI*i/8);\n var waveY = Math.sin(time*3.5 - Math.PI*i/8 - Math.PI/2);\n }\n if(window.shape == 'rect' \u0026\u0026 animate) {\n pen.drawRect(offsetX + i*cellWidth + waveX*3, offsetY + j*cellWidth + waveY*6, cellWidth - cellWidth/10 - waveX*1.2, cellWidth - cellWidth/10 - waveX*1.2);\n }\n if(window.shape == 'circle' \u0026\u0026 animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2 + waveX*3, offsetY + j*cellWidth + cellWidth/2 + waveY*6, cellWidth/2 - cellWidth/10 - waveX*1.2);\n }\n }\n } else {\n if(grid[i]===undefined) continue;\n pen.fillColor = grid[i];\n if(window.shape == 'rect' \u0026\u0026 !animate) {\n pen.drawRect(offsetX + i*cellWidth, offsetY, cellWidth - cellWidth/10, cellWidth - cellWidth/10);\n }\n if(window.shape == 'circle' \u0026\u0026 !animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2, offsetY + cellWidth/2, cellWidth/2 - cellWidth/10);\n }\n if(animate) {\n var waveX = Math.sin(time*3.5 - Math.PI*i/8);\n var waveY = Math.sin(time*3.5 - Math.PI*0/8 - Math.PI/2);\n }\n if(window.shape == 'rect' \u0026\u0026 animate) {\n pen.drawRect(offsetX + i*cellWidth + waveX*3, offsetY + waveY*6, cellWidth - cellWidth/10 - waveX*1.2, cellWidth - cellWidth/10 - waveX*1.2);\n }\n if(window.shape == 'circle' \u0026\u0026 animate) {\n pen.drawCircle(offsetX + i*cellWidth + cellWidth/2 + waveX*3, offsetY + cellWidth/2 + waveY*6, cellWidth/2 - cellWidth/10 - waveX*1.2);\n }\n }\n }\n\n if(index) {\n var size = cellWidth/3 \u003e 30 ? 30 : cellWidth/3;\n console.log(cellWidth/3)\n for(var i=0; i\u003cw; i++) {\n print(i, offsetX + i*cellWidth, offsetY - size*1.5, \"white\", size);\n }\n if(h \u003e 1) {\n for(var i=0; i\u003ch; i++) {\n print(i, offsetX - size*1.5, offsetY + i*cellWidth, \"white\", size);\n }\n }\n }\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":410,"hashid":"jzmsen93","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":264954,"file_name":"0.png","project_id":12423,"asset_id":27843,"created_at":"2017-09-27T12:19:34.350+08:00","updated_at":"2017-09-27T12:19:34.350+08:00"},{"id":264955,"file_name":"1.svg","project_id":12423,"asset_id":27844,"created_at":"2017-09-27T12:19:34.354+08:00","updated_at":"2017-09-27T12:19:34.354+08:00"},{"id":264956,"file_name":"2.png","project_id":12423,"asset_id":27845,"created_at":"2017-09-27T12:19:34.357+08:00","updated_at":"2017-09-27T12:19:34.357+08:00"},{"id":264957,"file_name":"0.wav","project_id":12423,"asset_id":27846,"created_at":"2017-09-27T12:19:34.359+08:00","updated_at":"2017-09-27T12:19:34.359+08:00"},{"id":264958,"file_name":"1.wav","project_id":12423,"asset_id":27847,"created_at":"2017-09-27T12:19:34.362+08:00","updated_at":"2017-09-27T12:19:34.362+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦