{"id":172120,"student_id":1874,"content":"import random\nimport game\n# 設定上下界\nup_bound = 100\nlow_bound = 0\n\n# 產生0~100隨機數\nans=random.randint(low_bound,up_bound)\n\nsetBackdrop(\"start.png\")\n\ndef onclick():\n global up_bound, low_bound, ans\n # 輸入猜測值\n a=int(input('請輸入'+str(low_bound)+'~'+str(up_bound)))\n # 判斷猜測值是否在上下界範圍內\n if a\u003c=up_bound and a\u003eans :\n game.set_backdrop(\"big.png\")\n up_bound=a\n if a\u003e=low_bound and a\u003cans:\n game.set_backdrop(\"small.png\")\n low_bound=a\n if a==ans:\n game.set_backdrop(\"bingo.png\")\n up_bound=a\n low_bound=a\n # 及判斷猜測值與密碼是否相等\n # 更新上下界\n\ndef loop():\n # 顯示上下界範圍\n game.draw_text(low_bound,500,750,'black',70)\n game.draw_text('~',625,750,'black',70)\n game.draw_text(up_bound,700,750,'black',70)\ngame.forever(loop)\ngame.on(\"click\", onclick)","created_at":"2020-07-27T13:20:28.658+08:00","updated_at":"2020-07-27T14:47:56.203+08:00","name":"終極密碼_S 副本","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/172120/ef5879b8a264a55b1453155ea72fb553.jpg"},"parent_id":162825,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":110,"hashid":"6rpsp6er","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2967967,"file_name":"start.png","project_id":172120,"asset_id":231968,"created_at":"2020-07-27T13:20:28.663+08:00","updated_at":"2020-07-27T13:20:28.663+08:00"},{"id":2967968,"file_name":"small.png","project_id":172120,"asset_id":231967,"created_at":"2020-07-27T13:20:28.664+08:00","updated_at":"2020-07-27T13:20:28.664+08:00"},{"id":2967969,"file_name":"bingo.png","project_id":172120,"asset_id":231966,"created_at":"2020-07-27T13:20:28.666+08:00","updated_at":"2020-07-27T13:20:28.666+08:00"},{"id":2967970,"file_name":"big.png","project_id":172120,"asset_id":231965,"created_at":"2020-07-27T13:20:28.667+08:00","updated_at":"2020-07-27T13:20:28.667+08:00"}]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦