{"id":142307,"student_id":2002,"content":"Game.set({\n autoRendering: false\n});\npen.size = 0;\nvar a = 0;\nvar b = 0;\npen.fillColor = \"white\";\npen.drawRect(0, 0, 640, 480);\n\nforever(function() {\n pen.fillColor = \"#f2fffe\";\n pen.drawRect(0, 0, 250, 50);\n print(\"PI:\" + b / a * 4, 5, 5, \"black\", 15);\n var x = Math.random() * 480;\n var y = Math.random() * 480;\n pen.fillColor = \"red\";\n pen.drawRect(x, y, 2, 2);\n var x2 = Math.random() * 480;\n var y2 = Math.random() * 480;\n var dis = Math.sqrt((x2 - 240)*(x2 - 240) + (y2 - 240)*(y2 - 240));\n if (dis \u003c= 240) {\n pen.fillColor = \"gold\";\n b++;\n } else\n pen.fillColor = \"red\";\n\n a++;\n pen.drawRect(x2, y2, 2, 2);\n});","created_at":"2020-04-19T14:24:02.999+08:00","updated_at":"2020-04-19T15:16:35.321+08:00","name":"蒙地卡羅求 PI 副本 副本","language":"javascript","screenshot":{"url":"https://cdn6.koding.school/uploads/project/screenshot/142307/599363ffc1cd6feecb8fbe2c36935556.jpg"},"parent_id":122131,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":54,"hashid":"36ysprnk","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
到這台電腦