本次博客连接
结对同窗博客连接
github项目地址html
童景霖:完成AI的实现
黄永福:完成UI的实现python
PSP2.1 | Personal Software Process Stages | 预估耗时(分钟) | 实际耗时(分钟) |
---|---|---|---|
· Planning | · 计划 | 30 | 20 |
· Estimate | · 估计这个任务须要多少时间 | 20 | 20 |
· Development | · 开发 | 240 | 300 |
· Analysis | · 需求分析 (包括学习新技术) | 200 | 600 |
· Design Spec | · 生成设计文档 | 30 | 30 |
· Design Review | · 设计复审 | 20 | 20 |
· Coding Standard | · 代码规范 (为目前的开发制定合适的规范) | 10 | 10 |
· Design | · 具体设计 | 60 | 80 |
· Coding | · 具体编码 | 200 | 240 |
· Code Review | · 代码复审 | 30 | 30 |
· Test | · 测试(自我测试,修改代码,提交修改) | 30 | 40 |
· Reporting | · 报告 | 40 | 60 |
· Test Repor | · 测试报告 | 20 | 15 |
· Size Measurement | · 计算工做量 | 20 | 25 |
· Postmortem & Process Improvement Plan | · 过后总结, 并提出过程改进计划 | 20 | 20 |
· 合计 | 970 | 1510 |
将API返回的数据格式转换,利用json.load()转换成字典对象,再对字典进行处理得到所须要的数据git
def find_card(c_list): s1 = 0 s0 = 0 for x0 in itertools.combinations(c_list, 5): list1 = c_list.copy() x0 = list(x0) a = gets_core(x0, 5) if a < 20 : continue for y0 in x0: list1.remove(y0) for x1 in itertools.combinations(list1, 5): list2 = list1.copy() x1 = list(x1) for y1 in x1: list2.remove(y1) x2 = list2 b = gets_core(x1,5) c = gets_core(x2,3) if (a >= b) and (b >= c): s1 = a + 1.5*b + 2*c if s1 > s0: s0 = s1 global card card.clear() # 3 x2 str2 = get_str(x2,3) # 5 x1 str1 = get_str(x1,5) # 5 x0 str0 = get_str(x0,5) card.append(str2) card.append(str1) card.append(str0)
利用itertools迭代器的combinations函数从13张牌中抽取5张做为后墩,判断后墩牌型,若为散牌则直接跳过;再从剩下的8张牌中抽取5张作为中墩,判断中墩牌型,若比后墩大,则直接跳过,从新搜索中墩;剩下的3张牌为前墩。
将各类牌型赋予必定的分数值,将前中后墩的牌型分数相加获得总分,总分最高的牌即为最终牌型,并返回。github
class IndexDetail(QtWidgets.QDialog, history_detail.Ui_Dialog): def __init__(self, parent=None, *args, **kwargs): super().__init__(parent, *args, **kwargs) self.setupUi(self) self.res = API.history(MainWindow.TokenMine, IndexHistory.pid) print(self.res['status']) if self.res['status'] == 0: self.res = self.res['data'] self.res = self.res['detail'] self.label_name.setText(str(self.res[0]['name'])) self.label_score.setText(str(self.res[0]['score'])) self.label_card.setText(str(self.res[0]['card'])) self.label_name_2.setText(str(self.res[1]['name'])) self.label_score_2.setText(str(self.res[1]['score'])) self.label_card_2.setText(str(self.res[1]['card'])) self.label_name_3.setText(str(self.res[2]['name'])) self.label_score_3.setText(str(self.res[2]['score'])) self.label_card_3.setText(str(self.res[2]['card'])) self.label_name_4.setText(str(self.res[3]['name'])) self.label_score_4.setText(str(self.res[3]['score'])) self.label_card_4.setText(str(self.res[3]['card'])) else: self.label_card.setText('status:'+str(self.res['status'])) def back(self): self.close() w = IndexHistory(window) w.show()
def getnum(a): return a.num def tonghuashu(dun_b): lista = [] listb = [] listc = [] listd = [] #分类 for s in dun_b: if s.color == "#": lista.append(s) elif s.color == "$": listb.append(s) elif s.color == "&": listc.append(s) elif s.color == "*": listd.append(s) #排序 lista.sort(key=getnum) listb.sort(key=getnum) listc.sort(key=getnum) listd.sort(key=getnum) if len(lista) == 5: liste = lista elif len(listb) == 5: liste = listb elif len(listc) == 5: liste = listc elif len(listd) == 5: liste = listd else: liste = [] l = len(liste) i = 1 if l == 5: flag = True while i < l: if liste[i].num != liste[i-1].num+1: flag = False break i = i+1 else: flag =False if flag is True: return liste[0].num else: return 0 a = tonghuashu(list) print(a)
传入的牌事先通过处理以类的形式存放于列表s中,先将他们根据不一样的花色进行分类,若某一种花色的数量达到5,再将其按牌的大小进行排序,检查是不是连续的牌型,是则为同花顺。json
调用显示继承来的窗口发生跳出api
发现继承来的窗口未定义自定义槽函数,一经调用,立马跳出!网络
是app
第N周 | 新增代码(行) | 累计代码(行) | 本周学习耗时(小时) | 累计学习耗时(小时) | 重要成长 |
---|---|---|---|---|---|
6 | 0 | 0 | 8 | 8 | 学习并能简单使用墨刀、ps等软件 |
7 | 800 | 800 | 12 | 20 | 学习python |
8 | 1200 | 2000 | 12 | 32 | 学习python和pyqt5 |