{"id":41141,"student_id":1976,"content":"stopRendering();\npen.size = 0;\npen.fillColor = \"white\"\npen.drawRect(0, 0, 640, 480);\nvar circle = 0;\nvar square = 0;\nvar pi;\nforever(function() {\n for (var i = 0; i \u003c 1000; i++) {\n var x = Math.random() * 480\n var y = Math.random() * 480\n var d = Math.sqrt((x-240)*(x-240) + (y-240)*(y-240))\n square++\n if (d \u003c= 240) {\n pen.fillColor = \"orange\"\n circle++\n } else {\n pen.fillColor = \"red\"\n }\n\n pen.drawRect(x, y, 1, 1);\n }\n pi = (circle*4)/square\n pen.fillColor = 'white';\n pen.drawRect(0, 0, 200, 35);\n print('PI: ' + pi, 10, 10);\n\n})","created_at":"2018-09-07T16:30:39.524+08:00","updated_at":"2019-11-10T07:35:41.013+08:00","name":"蒙地卡羅求 PI 副本","language":"javascript","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/41141/c317673df258fff526041c512b7b6d18.jpg"},"parent_id":31606,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":355,"hashid":"npmswqrz","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
到這台電腦