{"id":162861,"student_id":2589,"content":"import game\nimport random\nimport time\n\nt_s = time.time()\n\nalphabets = ['a', 'b', 'c', 'd', 'e', \n 'f', 'g', 'h', 'i', 'j',\n 'k', 'l', 'm', 'n', 'o', \n 'p', 'q', 'r', 's', 't', \n 'u', 'v', 'w', 'x', 'y', \n 'z']\n\nalphabet = random.randint(0, len(alphabets)-1)\ncorrect = 0\nfinish = 200\n\ndef main():\n global alphabet, correct, finish\n \n timer = time.time()-t_s\n game.draw_text(timer, 600, 700, 'black', 90)\n game.draw_text(\"進度\"+str(correct*100/finish)+\"%\", 600, 600, 'black', 90)\n game.draw_text(alphabets[alphabet], 300, 300, 'black', 90)\n \n if key.a and alphabets[alphabet] == 'a':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n\n if key.b and alphabets[alphabet] == 'b':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n\n if key.c and alphabets[alphabet] == 'c':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.d and alphabets[alphabet] == 'd':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.e and alphabets[alphabet] == 'e':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.f and alphabets[alphabet] == 'f':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.g and alphabets[alphabet] == 'g':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.h and alphabets[alphabet] == 'h':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.i and alphabets[alphabet] == 'i':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.j and alphabets[alphabet] == 'j':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.k and alphabets[alphabet] == 'k':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.l and alphabets[alphabet] == 'l':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.m and alphabets[alphabet] == 'm':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.n and alphabets[alphabet] == 'n':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.o and alphabets[alphabet] == 'o':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.p and alphabets[alphabet] == 'p':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.q and alphabets[alphabet] == 'q':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.r and alphabets[alphabet] == 'r':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.s and alphabets[alphabet] == 's':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.t and alphabets[alphabet] == 't':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.u and alphabets[alphabet] == 'u':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.v and alphabets[alphabet] == 'v':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.w and alphabets[alphabet] == 'w':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.x and alphabets[alphabet] == 'x':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.y and alphabets[alphabet] == 'y':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if key.z and alphabets[alphabet] == 'z':\n alphabet = random.randint(0, len(alphabets)-1)\n correct += 1\n \n if correct == finish:\n stop()\n \ngame.forever(main)","created_at":"2020-07-06T01:55:25.678+08:00","updated_at":"2020-07-10T14:38:33.872+08:00","name":"英打練習_T ","language":"python","screenshot":{"url":null},"parent_id":160504,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":118,"hashid":"4y3sverr","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦