{"id":235264,"student_id":1998,"content":"Game.set({\n autoRendering: false, //改成手動繪圖\n width: 1000, //設定場景寬度\n height: 1000, //設定場景高度\n});\n\n//將遊戲場景塗成白色\npen.size = 0;\npen.fillColor = 'white';\npen.drawRect(0, 0, 1000, 1000);\n\nvar a = 0; //橘色的點\nvar b = 0; //紅色的點\n\nforever(loop); //重複不斷執行遊戲迴圈\n\n//遊戲主迴圈\nfunction loop () {\n for (var i = 0; i \u003c 1000; i++) {\n //.fillColor = 'red'\n var x = Math.random()*1000;\n var y = Math.random()*1000;\n var d = Math.sqrt((x-500)*(x-500)+(y-500)*(y-500));\n if (d \u003c= 500) {\n pen.fillColor = 'orange';\n a++;\n } else {\n pen.fillColor = 'red';\n b++;\n }\n pen.drawRect(x, y, 1, 1);\n\n }\n\n pen.fillColor = 'white';\n pen.drawRect(0, 20, 500, 50);\n print(a/(a+b)*4, 10, 40, 'black', 40);\n}\n\n","created_at":"2021-03-13T16:13:32.165+08:00","updated_at":"2021-03-13T17:44:06.312+08:00","name":"蒙地卡羅求 PI(預設版) 副本","language":"javascript","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/235264/196c85626d88cc6cea3c263d0c6c63db.jpg"},"parent_id":183395,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":33,"hashid":"5j3s984e9","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
到這台電腦