{"id":694687,"student_id":10,"content":"from game import *\nfrom random import randint\n\na = create_sprite(\"a.png\")\nb = create_sprite(\"b.png\")\nc = create_sprite(\"b.png\")\nd = create_sprite(\"b.png\")\n\nstatus = 0\n\nclock = 0\ncount = 0\nanswers = [0, 1, 2, 3]\nmy_answers = []\n\ndef start:\n global count, status\n answers.append(randint(0, 3))\n count = 0\n status = 1\n\ndef playA():\n global count, status\n if answers[count] == 0:\n count += 1\n else:\n gameover()\n\ndef playB():\n global count, status\n if answers[count] == 1:\n count += 1\n else:\n gameover()\n\ndef playC():\n if answers[count] == 2:\n count += 1\n else:\n gameover()\n\ndef playD():\n global count, status\n if answers[count] == 3:\n count += 1\n else:\n gameover()\n \n\ndef gameover():\n status = 3\n\n\ndef loop():\n global clock, count, status\n clock += 1\n \n if clock % 60 == 0 and count \u003c= len(answers) - 1 and status == 1:\n num = answers[count]\n if num == 0: print('a')\n if num == 1: print('b')\n if num == 2: print('c')\n if num == 3: print('d')\n count += 1\n \n if count == len(answers) and status == 1:\n status = 2\n count = 0\n \n if count == len(answers) and status == 2:\n start()\n\n\na.on('click', playA)\nb.on('click', playB)\nc.on('click', playC)\nd.on('click', playD)\nforever(loop)\n","created_at":"2024-02-09T16:19:58.435+08:00","updated_at":"2024-02-16T11:38:17.075+08:00","name":"記憶遊戲","language":"python","screenshot":{"url":null},"parent_id":4,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":61,"hashid":"zpesz6d35","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":15560919,"file_name":"cloud.png","project_id":694687,"asset_id":302343,"created_at":"2024-02-09T16:19:58.441+08:00","updated_at":"2024-02-09T16:19:58.441+08:00"},{"id":15560920,"file_name":"bg.jpg","project_id":694687,"asset_id":302344,"created_at":"2024-02-09T16:19:58.442+08:00","updated_at":"2024-02-09T16:19:58.442+08:00"},{"id":15560921,"file_name":"calm.mp3","project_id":694687,"asset_id":302345,"created_at":"2024-02-09T16:19:58.444+08:00","updated_at":"2024-02-09T16:19:58.444+08:00"},{"id":15560922,"file_name":"koding.png","project_id":694687,"asset_id":302346,"created_at":"2024-02-09T16:19:58.445+08:00","updated_at":"2024-02-09T16:19:58.445+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦