猫史档案馆


课堂随机点名

用户:呆若木鸟呆若木鸟查看:0 回复:0 评论:0 创建时间:2024-08-06T09:45:27


#coding = utf-8
from random import *
from time import *
import filecmp
print('呆若木鸟工作室出品')
print('特别鸣谢点猫科技林锦程老师悉心指导!')
print('欢迎使用课堂随机点名  版本:0.02.9.5  classic')
rz = ['2024.6.18 完成主体代码 0.01.1.9', '2024.6.18 更新还原代码 0.01.3.1', '2024.6.18 还原代码完善 0.01.4.6', '2024.6.18 修复倒计喵码 0.01.5.7', '2024.6.18 修复抽作业代码 0.01.7.0', '2024.6.18 修复抽作业代码 0.01.8.4', '2024.6.18 修复抽作业代码 0.02.0.0', '2024.6.20 修复抽作业代码 0.02.1.3', '2024.6.20 修复抽作业代码 0.02.2.5', '2024.6.18 修复抽作业代码 0.02.3.8', '2024.6.28 修复抽作业代码 0.02.5.0']
print('更新日志:')
for k in rz:
    print(k)
rz = ['2024.7.22 大更新!更新算法 0.02.8.7  classic','2024.8.5 大更新!更新GUI 0.02.9.5  classic']
for k in rz:
    print(k)
try:
    if filecmp.cmp('D:\\课堂随机点名\\身份.txt','D:\\课堂随机点名\\身份验证\\作者.txt'):
        sf = '作者'
    elif filecmp.cmp('D:\\课堂随机点名\\身份.txt','D:\\课堂随机点名\\身份验证\\管喵.txt') :
        sf = '管喵'
    elif filecmp.cmp('D:\\课堂随机点名\\身份.txt','D:\\课堂随机点名\\身份验证\\游客.txt') :
        sf = '游客'
        my = input('请输入密钥:')
except:
    sf = '游客'
    my = input('请输入密钥:')
print('你的身份为:',sf)
zt = 0
jg = 0
d = ctime()
if filecmp.cmp("D:\\课堂随机点名\\课堂随机点名-主程序.txt","C:\\Users\\Public\\TurtleWorkspace\\课堂随机点名-副本\\main.py"):
    e = input('发现新版本,是否更新?')
    if (e == '是'):
        gx1 = open('D:\\课堂随机点名\\课堂随机点名-主程序.txt','w', encoding='utf-8')
        gx2 = open('C:\\Users\\Public\\TurtleWorkspace\\课堂随机点名-副本\\main.py','r', encoding='utf-8')
        s = gx2.read()
        w = gx1.write(s)
        gx1.close()
        gx2.close()
        sleep(5)
        print('更新完成,正在安装......')
        for f in range(100):
            print((('正在安装' + str((f + 1))) + '%'))
            sleep(random())
        print('安装成功!')

list1 = [1, 2, 3, 4]
list2 = [5, 6, 7, 8]
list3 = [9, 10, 11, 12]
list4 = [13, 14, 15, 16]
qb = [喵,11,12,13,14,15,16]
global list5
while True:
    a = input('请输入模式:')
    if (a == '/mode1'):
        if (sf == '作者' or sf == '管喵' or my == '20140609Ljc'):
            try:
                jg = choice(qb)
                if jg in list1:
                    i = 0
                    for i in range(1,4):
                        qb.remove(i)
                elif jg in list2:
                    i = 0
                    for i in range(5,8):
                        qb.remove(i)
                elif jg in list3:
                    i = 0
                    for i in range(9,12):
                        qb.remove(i)
                elif jg in list4:
                    i = 0
                    for i in range(13,16):
                        qb.remove(i)
                print(jg)
            except:
                print('所有组都抽到了')
        else:
            if (list1 == []):
                try:
                    list5 = [choice(list2), choice(list3), choice(list4)]
                except IndexError:
                    if (list2 == []):
                        try:
                            list5 = [choice(list3), choice(list4)]
                        except IndexError:
                            if (list3 == []):
                                try:
                                    list5 = [choice(list4)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list3 == []) :
                        try:
                            list5 = [choice(list2), choice(list4)]
                        except IndexError:
                            if (list2 == []):
                                try:
                                    list5 = [choice(list4)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list4 == []) :
                        try:
                            list5 = [choice(list2), choice(list3)]
                        except IndexError:
                            if (list2 == []):
                                try:
                                    list5 = [choice(list3)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list2 == [] and list3 == []) :
                        try:
                            list5 = [choice(list4)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list2 == [] and list4 == []) :
                        try:
                            list5 = [choice(list3)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list3 == [] and list4 == []) :
                        try:
                            list5 = [choice(list2)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list2 == []) :
                try:
                    list5 = [choice(list1), choice(list3), choice(list4)]
                except IndexError:
                    if (list1 == []):
                        try:
                            list5 = [choice(list3), choice(list4)]
                        except IndexError:
                            if (list3 == []):
                                try:
                                    list5 = [choice(list4)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list3 == []) :
                        try:
                            list5 = [choice(list1), choice(list4)]
                        except IndexError:
                            if (list1 == []):
                                try:
                                    list5 = [choice(list4)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list4 == []) :
                        try:
                            list5 = [choice(list1), choice(list3)]
                        except IndexError:
                            if (list1 == []):
                                try:
                                    list5 = [choice(list3)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list1 == [] and list3 == []) :
                        try:
                            list5 = [choice(list4)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list1 == [] and list4 == []) :
                        try:
                            list5 = [choice(list3)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list3 == [] and list4 == []) :
                        try:
                            list5 = [choice(list1)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list3 == []) :
                try:
                    list5 = [choice(list1), choice(list2), choice(list4)]
                except IndexError:
                    if (list1 == []):
                        try:
                            list5 = [choice(list2), choice(list4)]
                        except IndexError:
                            if (list2 == []):
                                try:
                                    list5 = [choice(list4)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list2 == []) :
                        try:
                            list5 = [choice(list1), choice(list4)]
                        except IndexError:
                            if (list1 == []):
                                try:
                                    list5 = [choice(list4)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list4 == []) :
                        try:
                            list5 = [choice(list1), choice(list2)]
                        except IndexError:
                            if (list1 == []):
                                try:
                                    list5 = [choice(list2)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list1 == [] and list2 == []) :
                        try:
                            list5 = [choice(list4)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list1 == [] and list4 == []) :
                        try:
                            list5 = [choice(list2)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list2 == [] and list4 == []) :
                        try:
                            list5 = [choice(list1)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list4 == []) :
                try:
                    list5 = [choice(list1), choice(list2), choice(list3)]
                except IndexError:
                    if (list1 == []):
                        try:
                            list5 = [choice(list2), choice(list3)]
                        except IndexError:
                            if (list1 == []):
                                try:
                                    list5 = [choice(list4)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list3 == []) :
                        try:
                            list5 = [choice(list1), choice(list2)]
                        except IndexError:
                            if (list1 == []):
                                try:
                                    list5 = [choice(list2)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list2 == []) :
                        try:
                            list5 = [choice(list1), choice(list3)]
                        except IndexError:
                            if (list1 == []):
                                try:
                                    list5 = [choice(list3)]
                                except IndexError:
                                    print('所有组都抽到了')
                                    zt = 1
                    elif (list1 == [] and list3 == []) :
                        try:
                            list5 = [choice(list2)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list1 == [] and list2 == []) :
                        try:
                            list5 = [choice(list3)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list2 == [] and list3 == []) :
                        try:
                            list5 = [choice(list1)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list1 == [] and list2 == []) :
                try:
                    list5 = [choice(list3), choice(list4)]
                except IndexError:
                    if (list3 == []):
                        try:
                            list5 = [choice(list4)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list4 == []) :
                        try:
                            list5 = [choice(list3)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list1 == [] and list3 == []) :
                try:
                    list5 = [choice(list2), choice(list4)]
                except IndexError:
                    if (list2 == []):
                        try:
                            list5 = [choice(list4)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list4 == []) :
                        try:
                            list5 = [choice(list2)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list1 == [] and list4 == []) :
                try:
                    list5 = [choice(list2), choice(list3)]
                except IndexError:
                    if (list2 == []):
                        try:
                            list5 = [choice(list3)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list3 == []) :
                        try:
                            list5 = [choice(list2)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list2 == [] and list3 == []) :
                try:
                    list5 = [choice(list1), choice(list4)]
                except IndexError:
                    if (list1 == []):
                        try:
                            list5 = [choice(list4)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list4 == []) :
                        try:
                            list5 = [choice(list1)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list2 == [] and list4 == []) :
                try:
                    list5 = [choice(list1), choice(list3)]
                except IndexError:
                    if (list1 == []):
                        try:
                            list5 = [choice(list3)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list3 == []) :
                        try:
                            list5 = [choice(list1)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list3 == [] and list4 == []) :
                try:
                    list5 = [choice(list1), choice(list2)]
                except IndexError:
                    if (list1 == []):
                        try:
                            list5 = [choice(list2)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    elif (list2 == []) :
                        try:
                            list5 = [choice(list1)]
                        except IndexError:
                            print('所有组都抽到了')
                            zt = 1
                    else :
                        print('所有组都抽到了')
                        zt = 1
            elif (list1 == [] and list2 == [] and list3 == []) :
                try:
                    list5 = [choice(list4)]
                except IndexError:
                    print('所有组都抽到了')
                    zt = 1
            elif (list1 == [] and list2 == [] and list4 == []) :
                try:
                    list5 = [choice(list3)]
                except IndexError:
                    print('所有组都抽到了')
                    zt = 1
            elif (list1 == [] and list3 == [] and list4 == []) :
                try:
                    list5 = [choice(list2)]
                except IndexError:
                    print('所有组都抽到了')
                    zt = 1
            elif (list2 == [] and list3 == [] and list4 == []) :
                try:
                    list5 = [choice(list1)]
                except IndexError:
                    print('所有组都抽到了')
                    zt = 1
            elif (list1 == [] and list2 == [] and list3 == [] and list4 == []) :
                print('所有组都抽到了')
                zt = 1
            else :
                list5 = [choice(list1), choice(list2), choice(list3), choice(list4)]
            try:
                if (zt == 0):
                    jg = choice(list5)
            except IndexError:
                jg = choice(喵,11,12,13,14,15,16)
            if (jg in list1):
                list1 = []
            elif (jg in list2) :
                list2 = []
            elif (jg in list3) :
                list3 = []
            elif (jg in list4) :
                list4 = []
            print(jg)
    elif (a == '/mode2') :
        print(ctime())
    elif (a == '/mode3') :
        b = int(input('请输入要计时的时间(单位:分钟)'))
        c = (b * 60)
        for i in range(c):
            print((c - i))
            sleep(1)
        print('时间到了')
    elif (a == '/mode4') :
        qb = [喵, 11, 12, 13, 14, 15, 16]
        qbjg = choice(qb)
        print(qbjg)
    elif (a == 'exit') :
        list1 = [1, 2, 3, 4]
        list2 = [5, 6, 7, 8]
        list3 = [9, 10, 11, 12]
        list4 = [13, 14, 15, 16]
        list5 = []
        print('正在还原1/4')
        a = 0
        sleep(1.5)
        print('正在还原2/4')
        b = 0
        sleep(1)
        print('正在还原3/4')
        c = 0
        sleep(1)
        print('正在还原4/4')
        sleep(1)
        print('还原成功')
    elif (a == '/help') :
        print('/mode1每个组不会重复')
        print('/mode2查看当前时间')
        print('/mode3倒计时')
        print('/mode4抽全班')
        print('exit还原')
        print('/help获取帮助')
    elif (a == '修改') :
        if (sf != '游客'):
            print('该用户暂未开放使用权限')
        else :
            zs = int(input('第几组?'))
            init = input('加入还是删除?')
            xh = int(input('学号?'))
            if (init == '加入'):
                if (zs == 1):
                    list1.append(xh)
                elif (zs == 2) :
                    list2.append(xh)
                elif (zs == 3) :
                    list3.append(xh)
                elif (zs == 4) :
                    list4.append(xh)
            elif (init == '删除') :
                if (zs == 1):
                    del list1[list1.index(xh)]
                elif (zs == 2) :
                    del list2[list2.index(xh)]
                elif (zs == 3) :
                    del list3[list3.index(xh)]
                elif (zs == 4) :
                    del list4[list4.index(xh)]
    else :
        print('没有该模式')


回复

上一页1 页 / 共 0下一页