60c256f91b 2024-06-27 1: -- 不用这套方案了
60c256f91b 2024-06-27 2: --~ 卡对排
60c256f91b 2024-06-27 3: function d.荐名(u1_0)
60c256f91b 2024-06-27 4: local h1_0
60c256f91b 2024-06-27 5: --~ 卡名对
60c256f91b 2024-06-27 6: h1_0 = 历对库.历对(u1_0, d.卡对消重)
60c256f91b 2024-06-27 7: return 对库.对长(h1_0)
60c256f91b 2024-06-27 8: end
60c256f91b 2024-06-27 9: --~ 卡对
60c256f91b 2024-06-27 10: function d.卡对消重(u1, u1_0)
60c256f91b 2024-06-27 11: return u1_0.name, true
60c256f91b 2024-06-27 12: end
60c256f91b 2024-06-27 13: --~ 卡对排
60c256f91b 2024-06-27 14: function d.荐名(u1_0)
60c256f91b 2024-06-27 15: local h1, h2
60c256f91b 2024-06-27 16: local h1_0
60c256f91b 2024-06-27 17: --~ 攻击力排
60c256f91b 2024-06-27 18: h1_0 = 历排库.历排(u1_0, 筛卡库.筛怪兽卡)
60c256f91b 2024-06-27 19: h1_0 = 历排库.历排(h1_0, 筛卡库.筛攻击力)
60c256f91b 2024-06-27 20: if h1_0[1] then
60c256f91b 2024-06-27 21: --~ 攻击力均差阶
60c256f91b 2024-06-27 22: h1 = 排算库.均差(h1_0)
60c256f91b 2024-06-27 23: if h1 > 0 then
60c256f91b 2024-06-27 24: --~ 补值
60c256f91b 2024-06-27 25: h2 = 数库.指数(100, 基算库.除法(h1, 300))
60c256f91b 2024-06-27 26: h1 = 基算库.除法(基算库.加法(h1, h2), 100)
60c256f91b 2024-06-27 27: if h1 > 1 then
60c256f91b 2024-06-27 28: h1 = 数库.指数次(h1, 2)
60c256f91b 2024-06-27 29: return 数库.向下取整(h1)
60c256f91b 2024-06-27 30: else
60c256f91b 2024-06-27 31: return 0
60c256f91b 2024-06-27 32: end
60c256f91b 2024-06-27 33: else
60c256f91b 2024-06-27 34: return 0
60c256f91b 2024-06-27 35: end
60c256f91b 2024-06-27 36: else
60c256f91b 2024-06-27 37: return 0
60c256f91b 2024-06-27 38: end
60c256f91b 2024-06-27 39: end
60c256f91b 2024-06-27 40: --~ 卡对排
60c256f91b 2024-06-27 41: function d.荐名(u1_0)
60c256f91b 2024-06-27 42: local h1
60c256f91b 2024-06-27 43: --~ 名
60c256f91b 2024-06-27 44: h1 = d.荐字段名(u1_0)
60c256f91b 2024-06-27 45: if h1 then
60c256f91b 2024-06-27 46: else
60c256f91b 2024-06-27 47: h1 = d.荐卡名(u1_0)
60c256f91b 2024-06-27 48: end
60c256f91b 2024-06-27 49: if h1 then
60c256f91b 2024-06-27 50: return h1
60c256f91b 2024-06-27 51: else
60c256f91b 2024-06-27 52: return "请便"
60c256f91b 2024-06-27 53: end
60c256f91b 2024-06-27 54: end
60c256f91b 2024-06-27 55: --~ 卡对排
60c256f91b 2024-06-27 56: function d.荐卡名(u1_0)
60c256f91b 2024-06-27 57: local h1_0
60c256f91b 2024-06-27 58: --~ 卡名排
60c256f91b 2024-06-27 59: h1_0 = 历排库.历排(u1_0, d.取卡名)
60c256f91b 2024-06-27 60: return 历排取一库.筛最短文(h1_0)
60c256f91b 2024-06-27 61: end
60c256f91b 2024-06-27 62: --~ 卡对
60c256f91b 2024-06-27 63: function d.取卡名(u1_0)
60c256f91b 2024-06-27 64: return u1_0.name
60c256f91b 2024-06-27 65: end
60c256f91b 2024-06-27 66: --~ 卡对排
60c256f91b 2024-06-27 67: function d.取字段对(u1_0)
60c256f91b 2024-06-27 68: local h1, h2, h3, h4
60c256f91b 2024-06-27 69: local h1_0
60c256f91b 2024-06-27 70: --~ 字段对
60c256f91b 2024-06-27 71: h1_0 = {}
60c256f91b 2024-06-27 72: for u1 = 1, #u1_0 do
60c256f91b 2024-06-27 73: --~ 字段数
60c256f91b 2024-06-27 74: h1 = 字节库.to_uint64(u1_0[u1].setcode)
60c256f91b 2024-06-27 75: if h1 < 1 then
60c256f91b 2024-06-27 76: else
60c256f91b 2024-06-27 77: if h1 > 0xffffFFFFffff then
60c256f91b 2024-06-27 78: h1 = h1 - 1
60c256f91b 2024-06-27 79: else
60c256f91b 2024-06-27 80: for u2 = 1, 11112222 do
60c256f91b 2024-06-27 81: if h1 < 1 then
60c256f91b 2024-06-27 82: break
60c256f91b 2024-06-27 83: else
60c256f91b 2024-06-27 84: --~ 大字段号
60c256f91b 2024-06-27 85: h2 = 位算库.位和(h1, 0xffff)
60c256f91b 2024-06-27 86: h1 = 位算库.位右移(h1, 基算库.乘法(4, 4))
60c256f91b 2024-06-27 87: --~ 字段名
60c256f91b 2024-06-27 88: h3 = 字段名对[tonumber(h2)]
60c256f91b 2024-06-27 89: if h3 then
60c256f91b 2024-06-27 90: if h1_0[h3] then
60c256f91b 2024-06-27 91: h1_0[h3] = 基算库.加法(h1_0[h3], 1)
60c256f91b 2024-06-27 92: else
60c256f91b 2024-06-27 93: h1_0[h3] = 1
60c256f91b 2024-06-27 94: end
60c256f91b 2024-06-27 95: if h2 > 0xfff then
60c256f91b 2024-06-27 96: --~ 小字段号
60c256f91b 2024-06-27 97: h4 = 位算库.位和(h2, 0xfff)
60c256f91b 2024-06-27 98: h3 = 字段名对[tonumber(h4)]
60c256f91b 2024-06-27 99: if h3 then
60c256f91b 2024-06-27 100: if h1_0[h3] then
60c256f91b 2024-06-27 101: h1_0[h3] = 基算库.加法(h1_0[h3], 1)
60c256f91b 2024-06-27 102: else
60c256f91b 2024-06-27 103: h1_0[h3] = 1
60c256f91b 2024-06-27 104: end
60c256f91b 2024-06-27 105: else
60c256f91b 2024-06-27 106: end
60c256f91b 2024-06-27 107: else
60c256f91b 2024-06-27 108: end
60c256f91b 2024-06-27 109: else
60c256f91b 2024-06-27 110: end
60c256f91b 2024-06-27 111: end
60c256f91b 2024-06-27 112: end
60c256f91b 2024-06-27 113: end
60c256f91b 2024-06-27 114: end
60c256f91b 2024-06-27 115: end
60c256f91b 2024-06-27 116: return h1_0
60c256f91b 2024-06-27 117: end
60c256f91b 2024-06-27 118: --~ 卡对排
60c256f91b 2024-06-27 119: function d.荐字段名(u1_0)
60c256f91b 2024-06-27 120: local h1
60c256f91b 2024-06-27 121: local h1_0
60c256f91b 2024-06-27 122: --~ 字段对
60c256f91b 2024-06-27 123: h1_0 = d.取字段对(u1_0)
60c256f91b 2024-06-27 124: --~ 最大的字段名数量
60c256f91b 2024-06-27 125: _, h1 = 历对取一库.筛最大值(h1_0)
60c256f91b 2024-06-27 126: --~ 最高频字段名对
60c256f91b 2024-06-27 127: h2_0 = 历对库.历对(h1_0, 历对库.全等筛值, h1)
60c256f91b 2024-06-27 128: return 历对取一库.筛最短键(h2_0)
60c256f91b 2024-06-27 129: end