{"id":154697,"student_id":10,"content":"setBackdrop('black');\n\non('click', start); //點擊畫面輸入天數\nforever(loop); //重複不斷執行遊戲回圈\n\nvar text = '';\nvar arr = [0, 1, 1]; //紀錄數列的數字\n\nfunction start () {\n var day = prompt('天數?');\n var result = fib(day);\n text = `經過了 ${day} 天,現在總共有 ${result} 隻兔子!`;\n}\n\nfunction fib (day) {\n var a = 1;\n var b = 1;\n \n for (var i = 3; i \u003c= day; i++) {\n var tmp = a + b;\n a = b;\n b = tmp;\n arr[i] = b;\n }\n\n return b;\n}\n\n\nfunction loop () {\n print(text, 100, 50, 'white', 30);\n \n for (var i = 1; i \u003c arr.length; i++) {\n print(`${i} 天,有${arr[i]}隻兔子`, 100, 100 + i*10, 'white', 10);\n }\n}","created_at":"2020-06-01T17:04:27.242+08:00","updated_at":"2020-06-01T17:19:13.732+08:00","name":"費氏數列","language":"javascript","screenshot":{"url":"/uploads/project/screenshot/154697/f4b8ec78780a59c89ac965add4e9bf2a.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":408,"hashid":"2pds8j84","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
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