{"id":70060,"student_id":10,"content":"// 可以修改預設密碼來測試\n// setPassword('password');\n\n// 不斷嘗試密碼並將分數高的排在前面,產生下一代的密碼\nforever(function() {\n})\n\n// 將兩組密碼進行組合\nfunction crossover (a, b) {\n}","created_at":"2019-05-26T10:10:58.897+08:00","updated_at":"2019-11-02T17:27:25.994+08:00","name":"遺傳演算法 副本","language":"javascript","screenshot":{"url":"/uploads/project/screenshot/70060/c4915b1b91ac1d6ab20a71a5a869b42c.jpg"},"parent_id":33940,"plugin":"setBackdrop('hacker1.jpg', 0, 0, 640, 480);\n\nvar game = (function () {\n \n var log = [];\n var key = 'I love Koding very much';\n var gameOver = false;\n \n when('click', function () {\n if (prompt('請輸入密碼?') == key) {\n setBackdrop('hacker2.jpg', 0, 0, 640, 480);\n setTimeout(function() {\n setBackdrop('hacker3.jpg', 0, 0, 640, 480);\n stop();\n }, 1000);\n }\n });\n \n function password (passwd) {\n if (gameOver) return;\n if (passwd == key) gameOver = true;\n \n log.unshift(passwd);\n var count = 0;\n for (var i = 0; i \u003c key.length; i++) {\n if (key[i] == passwd[i]) count++;\n }\n return count;\n }\n \n function setPassword (passwd) {\n key = passwd;\n }\n \n forever(function(){\n for (var i=0; i\u003c14 \u0026\u0026 i\u003clog.length; i++) {\n print(log[i], 50, 35 + 20*i, log[i] == key ? 'gold' : 'white');\n }\n });\n\n return {\n password: password,\n setPassword: setPassword\n }\n})();\n\nvar password = game.password;\nvar setPassword = game.setPassword;\n","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":497,"hashid":"gk4sm2e8","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":1227757,"file_name":"hacker2.jpg","project_id":70060,"asset_id":74924,"created_at":"2019-05-26T10:10:58.902+08:00","updated_at":"2019-05-26T10:10:58.902+08:00"},{"id":1227758,"file_name":"hacker3.jpg","project_id":70060,"asset_id":74923,"created_at":"2019-05-26T10:10:58.904+08:00","updated_at":"2019-05-26T10:10:58.904+08:00"},{"id":1227759,"file_name":"hacker1.jpg","project_id":70060,"asset_id":74922,"created_at":"2019-05-26T10:10:58.905+08:00","updated_at":"2019-05-26T10:10:58.905+08:00"}]
Orange Apple Learning Platform
My Projects
View Project Page
Export
Remix
Import
Delete
Download Android APP (APK)
Screenshot
繁中
简中
English
日本語
1:1:1
1:1
Full Width
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer
Scan the QRCode below with your phone to install
Or you can
download APK
to this computer