{"id":9862,"student_id":10,"content":"// test\nfor(var i=0; i\u003c80; i++) {\n grid[i] = [];\n for(var j=0; j\u003c40; j++) {\n if((i+j)%2 == 0) {\n grid[i][j] = \"yellow\";\n } else {\n grid[i][j] = \"green\";\n }\n }\n}","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-11T13:37:38.431+08:00","name":"grid","language":"javascript","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/9862/7ba8533ad23b6adefdac3ad86a106dca.jpg"},"parent_id":2,"plugin":"setBackdrop(\"#222\");\n\nvar grid = [];\nvar padding = 50;\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 for(var i=0; i\u003cgrid.length; i++) {\n if(grid[i].constructor === Array) {\n for(var j=0; j\u003cgrid[i].length; j++) {\n pen.fillColor = grid[i][j];\n pen.drawRect(offsetX + i*cellWidth, offsetY + j*cellWidth, cellWidth - 2, cellWidth - 2);\n }\n } else {\n pen.fillColor = grid[i];\n pen.drawRect(offsetX + i*cellWidth, offsetY, cellWidth - 2, cellWidth - 2);\n }\n }\n\n});","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":463,"hashid":"wdks449j","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
到這台電腦