{"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":"https://cdn4.koding.school/uploads/project/screenshot/154697/f4b8ec78780a59c89ac965add4e9bf2a.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":235,"hashid":"2pds8j84","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
到這台電腦