{"id":8202,"student_id":1470,"content":"setBackdrop(\"black\");\nvar startingPoints = [];\nvar robotPoints = [];\nvar pen = Game.pen;\nvar iterations = 100000000;\nvar numberOfPoints = 3;\npen.color = \"white\";\npen.size = 2;\npen.fillColor = \"red\";\nvar robot = {\n x: 0,\n y: 0\n};\nwhen(\"mouseup\", function () {\n if (startingPoints.length \u003c numberOfPoints) {\n startingPoints.push({ x: cursor.x, y: cursor.y });\n if (startingPoints.length == numberOfPoints) {\n robot.x = startingPoints[0].x,\n robot.y = startingPoints[0].y\n }\n }\n});\n\nforever(function () {\n \n if (startingPoints.length == numberOfPoints) {\n pen.drawText(\"Iterations: \"+robotPoints.length, 100, 100, 20);\n for (var i = 0; i \u003c startingPoints.length; i++) {\n Game.pen.drawCircle(startingPoints[i].x, startingPoints[i].y, 5);\n }\n var point = Math.round(Math.random() * (numberOfPoints - 1));\n robot.x = (robot.x + startingPoints[point].x) / 2;\n robot.y = (robot.y + startingPoints[point].y) / 2;\n if(robotPoints.length \u003c= iterations){\n robotPoints.push({ x: robot.x, y: robot.y });\n }\n for (var i = 0; i \u003c robotPoints.length; i++) {\n Game.pen.drawCircle(robotPoints[i].x, robotPoints[i].y, 0.5);\n }\n \n\n\n }\n});\n\n//軟體用法: \n// 依照numberOfPoints變數來看,點選若干點,點點機器人就開始跑了!\n// 點點機器人的規則: \n// 隨機選擇一個頂點,朝那個頂點走一般的距離,重複。","created_at":"2017-03-01T20:52:04.729+08:00","updated_at":"2019-11-07T06:32:21.741+08:00","name":"好多三角形","language":"javascript","screenshot":{"url":"https://cdn5.koding.school/uploads/project/screenshot/8202/42e4d33e7631ec199648ab7dc6855584.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":446,"hashid":"jzms233","is_content_changed":null,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":182054,"file_name":"0.png","project_id":8202,"asset_id":6,"created_at":"2017-07-25T15:01:41.420+08:00","updated_at":"2017-07-25T15:01:41.420+08:00"},{"id":182055,"file_name":"1.svg","project_id":8202,"asset_id":7,"created_at":"2017-07-25T15:01:41.424+08:00","updated_at":"2017-07-25T15:01:41.424+08:00"},{"id":182056,"file_name":"2.png","project_id":8202,"asset_id":8,"created_at":"2017-07-25T15:01:41.428+08:00","updated_at":"2017-07-25T15:01:41.428+08:00"},{"id":182057,"file_name":"0.wav","project_id":8202,"asset_id":9,"created_at":"2017-07-25T15:01:41.431+08:00","updated_at":"2017-07-25T15:01:41.431+08:00"},{"id":182058,"file_name":"1.wav","project_id":8202,"asset_id":10,"created_at":"2017-07-25T15:01:41.434+08:00","updated_at":"2017-07-25T15:01:41.434+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦