{"id":28900,"student_id":10,"content":"setBackdrop(\"black\");\n\nvar dots = [];\n\nfunction randomDot () {\n var d = createSprite([\"w.png\", \"o.png\", \"r.png\"]);\n d.x = Math.random()*600 + 20;\n d.y = Math.random()*440 + 20;\n d.connects = [];\n dots.push(d);\n}\n\nfor (var i=0; i\u003c20; i++) randomDot();\n\nfunction randomConnect (dots) {\n var clone = dots.slice(0);\n while(clone.length \u003e 1) {\n clone.sort((a, b) =\u003e {\n return a.distanceTo(clone[0]) - b.distanceTo(clone[0]);\n });\n clone[0].connects.push(clone[1]);\n clone[1].connects.push(clone[0]);\n clone.shift();\n }\n dots.forEach((a) =\u003e {\n dots.forEach((b) =\u003e {\n if (a == b) return;\n if (a.connects.indexOf(b) != -1) return;\n if (a.distanceTo(b) \u003e 200) return;\n if (Math.random() \u003c 0.3) {\n a.connects.push(b);\n b.connects.push(a);\n }\n }); \n });\n}\n\nrandomConnect(dots);\n\nforever(()=\u003e{\n dots.forEach((a) =\u003e {\n a.connects.forEach((b) =\u003e {\n pen.color = 'white';\n pen.size = 2;\n pen.drawLine(a.x, a.y, b.x, b.y);\n });\n });\n});","created_at":"2018-05-15T18:17:29.124+08:00","updated_at":"2019-10-26T10:26:53.655+08:00","name":"Dijkstra","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/28900/5c2177643ded1af84a7604b57fdb3026.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":299,"hashid":"5j3sj3z8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":534196,"file_name":"o.png","project_id":28900,"asset_id":65031,"created_at":"2018-05-15T18:17:42.183+08:00","updated_at":"2018-05-15T18:17:42.183+08:00"},{"id":534197,"file_name":"r.png","project_id":28900,"asset_id":65032,"created_at":"2018-05-15T18:17:42.185+08:00","updated_at":"2018-05-15T18:17:42.185+08:00"},{"id":534198,"file_name":"w.png","project_id":28900,"asset_id":65033,"created_at":"2018-05-15T18:17:42.347+08:00","updated_at":"2018-05-15T18:17:42.347+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦